Hi Henning,

Henning P. Schmiedehausen wrote on Tuesday, September 06, 2005 6:09 PM:

[snip]

> => charAt is 3-4 times faster when not matching and almost twice as
>    fast when matching. For the short case it is even faster.
> 
> Get Test Class Source code from
> http://henning.schmiedehausen.org/code/EndOfTest.java
> 
> Another interesting point is that a method call seems to
> impose just a very small overhead. Even though the charAt
> test needs three of them in the worst case (length() and 2x
> charAt()), it is still faster than the single endsWith() method call.

Funny. Just by reviewing the code, I would not have expected to get sooo much 
difference.

>       Best regards
>               Henning (Micro-Optimizer and general nit-picker. ;-) )

<g>

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to