[PyTorch] Reduce copies/refcount bumps in BytecodeDeserializer::parseMethods (#63961)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63961
Saw a report that this function was slow and was doing unexplained vector copies. First pass to remove a bunch of copying.
ghstack-source-id: 136760976
Test Plan:
Pixel 3
before: https://our.intern.facebook.com/intern/aibench/details/461850118893980
after: https://www.internalfb.com/intern/aibench/details/48965886029524
MilanBoard failed to return data from simpleperf
Reviewed By: dhruvbird
Differential Revision: D30544551
fbshipit-source-id: 0e2b5471a10c0803d52c923e6fb5625f5542b99d