ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50200] New: VectorSet kills the performance of DirectoryScanner
Date Tue, 02 Nov 2010 20:53:11 GMT

           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

Created an attachment (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
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()) {
            else {
                super.add(index, o);
Now it is indeed faster than 1.7. By up to 30%.

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

View raw message