Set MINIZ_NO_TIME to avoid computing localtime on each pickle/unpickle (#27268)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27268
For small pickle/unpickle, we spend a disproportionate amount of time in
time functions - roughly 23% in __tzset() for unpickle case.
We're currently not using the .m_time currently, though we can add this feature
back if it's ever needed.
An alternative would be to -DMINIZ_NO_TIME in compiler_flags, but we would
need to also consistently # define MINIZ_NO_TIME in any .cpp including this .h,
since this # define modifies the struct length in an unfortunate manner.
Test Plan:
buck test mode/dev-nosan caffe2/test/...
Run benchmark:
buck-out/opt/gen/caffe2/torch/fb/distributed/thriftRpcBackend/test/ThriftRpcAgentBench
Differential Revision: D17724198
fbshipit-source-id: b44a0217b1d9f8ce6c0f24297f59045c7cadf4b1