Summary: | Zip task does O(n) lookup in hashtable | ||
---|---|---|---|
Product: | Ant | Reporter: | Marc Bevand <m.bevand> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 1.8.0 | ||
Target Milestone: | 1.8.1 | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Fixes the Zip task performance bug |
Ooops. fixed with svn revision 910825 thanks! Thanks. PS: you made a typo in my last name in the commit message (Bevand, not Beyand). Oh well :-) sorry about the spelling error, fixed now. an underlined v looks a lot like a y in the font I use in Firefox. |
Created attachment 25004 [details] 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