ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53803] New: performance problem in IdentityStack.retainAll()
Date Thu, 30 Aug 2012 18:43:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53803

          Priority: P2
            Bug ID: 53803
          Assignee: notifications@ant.apache.org
           Summary: performance problem in IdentityStack.retainAll()
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: nistor1@illinois.edu
          Hardware: PC
            Status: NEW
           Version: 1.8.4
         Component: Core
           Product: Ant

Created attachment 29310
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29310&action=edit
patch

IdentityStack.retainAll() has the same performance problem as the
previously fixed Bug 53622 (for VectorSet.retainAll()).  I attached a
patch similar to the one used by Jesse Glick in Bug 53622.  I also
attached a test that exposes this problem.  For this test, the patch
provides a 12X speedup on my machine.

To run the test, just do:

$ java Test

The output for the un-patched version is:
Time is 2758

The output for the patched version is:
Time is 225

Similarly to Bug 53622, the problem is that "retainAll(Collection<?> c)" 
performs "c.contains(e.next())", which is slow if for example "c" is a
list.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message