tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <Peter.Crowt...@melandra.com>
Subject RE: Code performance question #1
Date Mon, 07 Aug 2006 16:03:43 GMT
> From: Leon Rosenberg [mailto:rosenberg.leon@googlemail.com] 
> data.length is evaluated each time.
> 
> here's the example to demonstrate it:
[Example elided that reassigns data inside the loop]

That example would indeed be evaluated each time.  However, *if* the
compiler's sufficiently smart, it could detect that data and hence
data.length were not changed inside the OP's loop and optimise away the
test for .length each time.  That smarts would be compiler-specific, if
it can be done at all.

We're theorising here.  The real way is to test this is to write the
test harness and try it.

		- Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message