Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a Session to enable connection pooling
Requests and urllib3 automatically reuse connections if using a Session, which otherwise has all the same methods as the main Requests API, making this a drop-in replacement: http://docs.python-requests.org/en/latest/user/advanced/ In my tests, this change cut 830 HEAD requests to Foursquare's internal artifact cache from 22s to 11s. Testing Done: Using 830 cache keys copied from a real build, this change cut the time to do HEAD requests for each from 22s to 11s. https://travis-ci.org/pantsbuild/pants/builds/38515947 Reviewed at https://rbcommons.com/s/twitter/r/981/
- Loading branch information