docker/docker — pull request #9060 by naelyn (2014-11-10 04:54:19+00:00)
Title: Make 'docker push' faster at the small expense of extra registry disk space

Docker push currently uses default gzip settings to ship layers to the registry server. This is somewhat cpu intensive and annoying when doing frequent pushes (as you would when inserting Docker into your CI pipeline).

Instead of using the default gzip settings use `gzip.BestSpeed` which is faster but compresses less completely than the defaults. This pushes gzip closer to Google's Snappy compression library in spirit (["high speeds and reasonable compression"](https://code.google.com/p/snappy/)).

Timing comparision using the `google/golang` image over localhost into a sandbox registry:

```
# stock docker 1.3.1
$ time sudo docker push localhost:5050/google/golang
...
real	1m22.158s
user	0m0.217s
sys	0m0.138s

# docker 1.3.1 with the BestSpeed change
...
real	0m46.427s
user	0m0.224s
sys	0m0.133s
```

This is somewhat related to https://github.com/docker/docker/issues/7291 but that issue is locked from non-contributor comments.