Streamtokenizer

OneGuy oneguyks@gmail.com
Fri May 9 12:17:00 GMT 2008


On Fri, May 9, 2008 at 5:51 AM, Andrew Haley <aph@redhat.com> wrote:

> Could be.  That's one of the problems of microbenchmarks: they do
> unrealistic things and tend to magnify the importance of a tiny part
> of the code base.  The famous Dhrystone benchmark was hyper-sensitive
> to the performance of string copying.

True. However, there is no reason to convert char array into a String
and parse the String to number. The char array can be converted to a
number token easily in a loop with something like

number= number * 10 + (char - '0');



More information about the Java mailing list