You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jesse Glick <je...@oracle.com> on 2011/02/22 15:53:14 UTC

Re: list iteration (was: svn commit: r1066963 ...)

On 02/17/2011 11:30 PM, Kevin Jackson wrote:
> I tried to introduce some micro-optimizations
> (pretty much like these) into the Tomcat codebase 8 years ago, but was
> met with 'meh why bother?' responses as the thinking was that the vm
> would pretty much make optimizations pointless.  I suppose it depends
> on where the hotspots are.

And for a tool like Ant, it is unlikely that iterating a vector is consuming any measurable proportion of execution time, unless for some reason this particular vector is 
enormous or you are scanning it many thousands of times. Most of the time will be spent waiting for disk I/O, or CPU in some tool like javac. If you actually run a 
profiler on some typical loads and ignore unavoidable overhead (such as logically necessary file stats), usually you find some weird and vaguely embarrassing problem that 
you would never have guessed otherwise.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: list iteration (was: svn commit: r1066963 ...)

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

>> I tried to introduce some micro-optimizations
>> (pretty much like these) into the Tomcat codebase 8 years ago, but was
>> met with 'meh why bother?' responses as the thinking was that the vm
>> would pretty much make optimizations pointless.  I suppose it depends
>> on where the hotspots are.
>
> And for a tool like Ant, it is unlikely that iterating a vector is consuming
> any measurable proportion of execution time, unless for some reason this
> particular vector is enormous or you are scanning it many thousands of
> times. Most of the time will be spent waiting for disk I/O, or CPU in some
> tool like javac. If you actually run a profiler on some typical loads and
> ignore unavoidable overhead (such as logically necessary file stats),
> usually you find some weird and vaguely embarrassing problem that you would
> never have guessed otherwise.

Oh yes - agreed, no 'point' in optimising code which isn't actually
bogging the system down.  In my defence, I suggested these changes
when I was inexperienced - still it was my time to waste (the
advantage of open source software).  If I was messing with this stuff
while being paid to properly optimise some code I should have been
shot! :)

Measure first has been drummed into me now :)

Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org