Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor Zip related changes to reduce allocation hotspots #2

Closed
wants to merge 2 commits into from
+5,532 −2,507

3 participants

@parentjo
  • 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
@ifedorenko
Collaborator

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

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

@krosenvold
Collaborator

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
@rfscholte rfscholte referenced this pull request from a commit in rfscholte/plexus-archiver
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
Commits on Jul 1, 2012
  1. - Add convert() and getBytes() method to both ZipShort and ZipLong API

    Johan Parent authored
    - 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
  2. Line ending fun(?)

    Johan Parent authored
Something went wrong with that request. Please try again.