Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Minor Zip related changes to reduce allocation hotspots #2

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

parentjo commented Jul 1, 2012

  • Convert ZipFile and ZipOutputStream to use above mentioned methods to avoid object alloction hotspot (jprofiler) especially for large jars.
  • Create sufficiently large HashTable right away for all entries to avoid resizing penalty with large jars (like weblogic.jar ...)
  • Replace ArrayList with LinkedList to reduce alloc-copy overhead when creating large INDEX.LST file
  • Introduce Calendar per thread (with ThreadLocal) to avoid creating a new Calendar when creating the Date for every ZipEntry
  • Misc: move array allocation out of loop when possible
Johan Parent - Add convert() and getBytes() method to both ZipShort and ZipLong API
- Convert ZipFile and ZipOutputStream to use above mentioned methods to avoid object alloction hotspot (jprofiler) especially for large jars.
- Replace ArrayList with LinkedList to reduce alloc-copy overhead when creating large INDEX.LST file
- Introduce Calendar per thread (with ThreadLocal) to avoid creating a new Calendar when creating the Date for every ZipEntry
- Misc: move array allocation out of loop when possible
4fe94d7
Collaborator

ifedorenko commented Jul 1, 2012

Can you check/fix your end-of-line configuration, as explained in https://help.github.com/articles/dealing-with-line-endings ? Hard to review diffs when entire file shows as changed ;-)

parentjo commented Jul 1, 2012

ok gave it a try but I'll likely to make lots of git newbie mistakes. If so sorry

Collaborator

krosenvold commented Apr 17, 2013

Applied in 845587d, thanks for the patch!

Btw; are you /really/ sure the relative overhead of a thread local vs new-ing a Calendar ?

@krosenvold krosenvold closed this Apr 17, 2013

@rfscholte rfscholte pushed a commit to rfscholte/plexus-archiver that referenced this pull request May 4, 2015

Robert Scholte #2 ZipArchiver.setUpdateMode() doesn't work 082be62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment