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 2012/09/03 20:45:37 UTC

[Bug 53822] New: performance of IdentityStack.containsAll()

https://issues.apache.org/bugzilla/show_bug.cgi?id=53822

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

Created attachment 29322
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29322&action=edit
patchSmall.diff

"IdentityStack.containsAll(Collection coll)" has a similar performance
problem as the previously fixed Bug 53622 (for
"VectorSet.retainAll(Collection coll)").  The problem is that
"containsAll(Collection coll)" performs "this.contains(e.next())",
which is slow because "this" is an IdentityStack, i.e., a Vector, and
therefore "contains" is linear.

I attached a patch (patchSmall.diff) similar to the one used by Jesse
Glick in Bug 53622.  I attached an improved patch (patchFull.diff)
that builds the IdentityHashMap lazily, which gives slightly better
performance than patchSmall.diff (which builds IdentityHashMap
eagerly).  I also attached a test that exposes this problem.  For this
test, patchSmall.diff provides a 676X speedup on my machine.

To run the test, just do:

$ java Test

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

The output for the patched version is:
Time is 26

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

[Bug 53822] performance of IdentityStack.containsAll()

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

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.9.0                       |1.9.1

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

[Bug 53822] performance of IdentityStack.containsAll()

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

--- Comment #2 from Adrian Nistor <ni...@illinois.edu> ---
Created attachment 29324
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29324&action=edit
test

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

[Bug 53822] performance of IdentityStack.containsAll()

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

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.8.4                       |1.9.0

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

[Bug 53822] performance of IdentityStack.containsAll()

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

Jesse Glick <jg...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

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

[Bug 53822] performance of IdentityStack.containsAll()

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

Adrian Nistor <ni...@illinois.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nistor1@illinois.edu

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

[Bug 53822] performance of IdentityStack.containsAll()

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

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

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

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
svn revision 1554813

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

[Bug 53822] performance of IdentityStack.containsAll()

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

--- Comment #1 from Adrian Nistor <ni...@illinois.edu> ---
Created attachment 29323
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29323&action=edit
patchFull.diff

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