Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
archive/zip: reading many small files allocates a lot of memory #14289
archive/zip creates a new compress/flate.Reader for each file read from the archive. If there are many small files in an archive, this allocates a lot of memory.
compress/flate allows re-using of Readers, see https://codereview.appspot.com/97140043/
Using this in archive/zip reduces the amount of memory allocated/GCed. In a real-world scenario when reading ~ 500 small files from a ZIP archive this gives a speedup of 1.5x-2x.