tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: Code performance question #1
Date Mon, 07 Aug 2006 16:03:43 GMT
> From: Leon Rosenberg [] 
> 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:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message