From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-07-23 23:11:40
> If Gennadiy reads this, what do you think? Have you done some timing
> comparing the version with and without? If so, and if you found a
> difference, could you perhaps have mailed the timing-test to me?
Running proposition1.cpp on MSVC with STLPort. I see 20%-30% speed up depend
on input string. I think it significant enough, considering that most of the
time if should spend decoding integer from string.
P.S. Here 3 examples (I enhanced output a bit to be more expressive):
Input string: "1234"
std::string specified: 560
char const* specified: 541
char const* specified: 531
direct input stream1: 441
direct input stream2: 150
Input string: "1234032475"
std::string specified: 751
char const* specified: 711
char const* specified: 741
direct input stream1: 641
direct input stream2: 160
Input string: " 1234
std::string specified: 892
char const* specified: 851
char const* specified: 881
direct input stream1: 621
direct input stream2: 190
P.P.S. Note scanf performance on different examples
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk