https://issues.apache.org/bugzilla/show_bug.cgi?id=48755
Summary: Zip task does O(n) lookup in hashtable
Product: Ant
Version: 1.8.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=25004)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25004)
Fixes the Zip task performance bug
The ant zip task does an O(n) instead of O(1) lookup in a Hashtable when adding
files to the archive. The attached patch fixes this embarassing performance bug
by calling containsKey() instead of contains(). It applies cleanly to Ant
1.8.0.
I measured a 3x performance improvement with the jar task (based on the zip
task) when creating a jar from a directory containing 50 thousand files on my
system:
<jar destfile="foo.jar" basedir="dir-with-50k-files"/>
Before: 103 sec
After: 32 sec
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.