Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Minor Zip related changes to reduce allocation hotspots #2

Closed
wants to merge 2 commits into from

Conversation

parentjo
Copy link

@parentjo 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

- 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
@ifedorenko
Copy link

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
Copy link
Author

parentjo commented Jul 1, 2012

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

@krosenvold
Copy link
Contributor

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 pushed a commit to rfscholte/plexus-archiver that referenced this pull request May 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants