Optimize instrToString
Summary:
After
D5668519, emitting bytecode-as-text from hhvm --hphp is about
100x faster than before, but still very slow (it was taking a little
longer to emit the text versions of the bytecode than for hhbbc to
optimize the bytecode).
According to perf, at least 30% of the time was being spent in
std::locale::locale() and std::locale::~locale(), mostly called from
instrToString, with lots more in various ostringstream related
activities. So I made it write to strings directly using
folly::format, and got a roughly 3x speedup.
Reviewed By: mxw
Differential Revision:
D5670431
fbshipit-source-id:
f8a77e9a37870b26318607ff8d179944dd6c95c5