[PyTorch] Reduce copies/refcount bumps in BytecodeDeserializer::parseMethods (#63961)
authorScott Wolchok <swolchok@fb.com>
Mon, 30 Aug 2021 16:34:24 +0000 (09:34 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 30 Aug 2021 16:37:10 +0000 (09:37 -0700)
commit9777887f0ebe6403e19205eb1cafb81fe24606fb
tree7c0172829fc06f21835d6e098fde1724a314f112
parentdc4fd3bddab51970e53060f8cb1a3c316a28b042
[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
torch/csrc/jit/mobile/import.cpp