[JIT] Make new zip serialization for torch save/load significantly (~70%) faster (#38379)
Summary:
Before:
```
2020-05-11 18:31:41 INFO Benchmarking 'basic', best of 10 runs (with 1 warmup runs)
{
"Big Tensors Save": {
"mean": 17.8048762,
"median": 17.458917
},
"Big Tensors Load": {
"mean": 3.2556887,
"median": 2.9668495000000004
},
"Small Tensors Save": {
"mean": 4.0381357,
"median": 3.9440125
},
"Small Tensors Load": {
"mean": 5.8792499,
"median": 5.603067
},
"benchmark_run_at": "2020-05-12T01:31:41"
}
```
After
```
Use zipfile serialization: True
2020-05-12 20:15:32 INFO Benchmarking 'basic', best of 10 runs (with 1 warmup runs)
{
"Big Tensors Save": {
"mean": 4.7534657,
"median": 4.646732
},
"Big Tensors Load": {
"mean": 3.6001919,
"median": 3.493285
},
"Small Tensors Save": {
"mean": 4.1066924,
"median": 4.1219255
},
"Small Tensors Load": {
"mean": 6.3902358,
"median": 6.36977
},
"benchmark_run_at": "2020-05-13T03:15:32"
}
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38379
Differential Revision: D21779494
Pulled By: voznesenskym
fbshipit-source-id: 694d65029a5b817424d454bd331e285df828c67a