ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Bailliez" <sbaill...@apache.org>
Subject Re: Réf. : RE: Réf. : Re: Commons Validator
Date Thu, 07 Nov 2002 16:19:40 GMT
----- Original Message -----
From: <loic.lefevre@bnpparibas.com>

>Well it's just about 8% faster:
[...]

ah.

Byte.parseByte(String) is faster, you avoid an allocation.
Byte.parseByte(String, 10) is even faster you avoid a method call

 int i = Integer.parseInt(s, radix);
 return  !(i < Byte.MIN_VALUE || i > MAX_VALUE)
is even more faster. you avoid a method call and and an exception

and yet I suggest to copy/paste the Integer.parseInt method and use your own
by remove the exceptions to make it even more faster by removing yet another
method call and exception.

>ps: don't have the time to make a patch (sorry)

I see. Time problem.

ps: If you should read something about Knuth, read only his most famous
quote. really.
With Joe, you're taking the optimization step by the wrong end IMHO


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


Mime
View raw message