ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53622] New: performance problem in VectorSet.retainAll()
Date Mon, 30 Jul 2012 14:57:31 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53622

          Priority: P2
            Bug ID: 53622
          Assignee: notifications@ant.apache.org
           Summary: performance problem in VectorSet.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 29138
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29138&action=edit
patch

There is a performance problem in VectorSet.retainAll().  It appears
in version 1.8.4 and also in revision 1366777.  I attached a test that
exposes this problem and a patch that fixes it.  On my machine, for
this test, the patch provides a 319X speedup.

To run the test, just do:

$ java Test

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

The output for the patched version is:
Time is 25

The current implementation of "VectorSet.retainAll(Collection c)"
iterates over the elements in "VectorSet" and searches in "c", which
can be very slow, if for example "c" is a list.

The attached patch iterates over the elements of "c" and searched in
VectorSet, which is always very fast, because we can use the field
"HashSet set" in VectorSet.

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

Mime
View raw message