[PyTorch] Remove StringView from RecordFunction implementation [2/2] (#68411)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68411
Avoids heap-allocating a std::string instance in before() each time even if it's not going to be used.
ghstack-source-id: 144287655
Test Plan:
Run //caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads:cpp_benchmark before/after this diff with arguemnts --stressTestRecordFunction --op empty
Before: P467922606
After: P467922626
Reviewed By: chaekit
Differential Revision: D32453846
fbshipit-source-id: 18e1b482dbf5217add14cbaacd447de47cb5877b