ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50200] New: VectorSet kills the performance of DirectoryScanner
Date Tue, 02 Nov 2010 20:53:11 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50200

           Summary: VectorSet kills the performance of DirectoryScanner
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: sanduatwork@hotmail.com


Created an attachment (id=26250)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26250)
profiler screenshot

In my experience the performance of DirectoryScanner in 1.8 is at least twice
as bad as it was in 1.7. It was surprising, especially considering the 1.8
release notes mentioned improvements in that area.
I wrote a test that scans a very large directory structure and the profiler
indicates the problem is actually in VectorSet.
VectorSet.add can sometimes take longer to execute then the rest of the scandir
method.
A simple change in VectorSet seems to make all the difference:
=================================================================
    private synchronized void doAdd(int index, Object o) {
        // Calling super.add is safe
        // because stack overflow is avoided by the following "if"
        if (set.add(o)) {
            if (index==size()) {
                super.add(o);
            }
            else {
                super.add(index, o);
            }
        }
    }
=================================================================
Now it is indeed faster than 1.7. By up to 30%.

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

Mime
View raw message