Boost logo

Boost :

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
tests,
> comparing the version with and without? If so, and if you found a
reasonable
> 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.

Gennadiy.

P.S. Here 3 examples (I enhanced output a bit to be more expressive):

Input string: "1234"
unspecified: 781
std::string specified: 560
char const* specified: 541
char const* specified: 531
direct input stream1: 441
direct input stream2: 150
sscanf: 110

Input string: "1234032475"
unspecified: 971
std::string specified: 751
char const* specified: 711
char const* specified: 741
direct input stream1: 641
direct input stream2: 160
sscanf: 181

Input string: " 1234
"
unspecified: 1091
std::string specified: 892
char const* specified: 851
char const* specified: 881
direct input stream1: 621
direct input stream2: 190
sscanf: 802

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