You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/02/17 04:28:15 UTC

DO NOT REPLY [Bug 48755] New: Zip task does O(n) lookup in hashtable

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: notifications@ant.apache.org
        ReportedBy: m.bevand@gmail.com


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.

DO NOT REPLY [Bug 48755] Zip task does O(n) lookup in hashtable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48755

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.1

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-02-17 05:10:36 UTC ---
Ooops.

fixed with svn revision 910825

thanks!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 48755] Zip task does O(n) lookup in hashtable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48755

--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2010-02-17 08:56:00 UTC ---
sorry about the spelling error, fixed now.

an underlined v looks a lot like a y in the font I use in Firefox.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 48755] Zip task does O(n) lookup in hashtable

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48755

--- Comment #2 from Marc Bevand <m....@gmail.com> 2010-02-17 07:01:45 UTC ---
Thanks.

PS: you made a typo in my last name in the commit message (Bevand, not Beyand).
Oh well :-)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.