Re: Streamtokenizer

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
OneGuy wrote:
> On Fri, May 9, 2008 at 5:51 AM, Andrew Haley <[email protected]> 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');

Sure, and I expect that a properly tested patch which does that would
be accepted.  However, we have to ask the question "Why are we doing
this?"  Do we really believe that this may be important in the real
world, or are we doing it just for the sake of benchmarking?  Let's not
get into the situation where the authors of benchmarks decide what
code we will optimize.

Andrew.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.