mark.g.brown wrote:
Hi,
I have been working on a fix for STDCXX-493. The attached patch tries to
improve both the const_pointer and string overloads but makes no attempt
to do anything with the value_type overload. I was successful in making
the const_pointer overload run faster (about 6 times faster than in the
submitted test), but for some reason the patch doesn't help the string
overload. I'm fresh out of ideas at the moment and would welcome help
with it.
Thanks for the patch, Mark! I haven't had time to test it or to
try to get to the bottom of the discrepancy you're seeing. Let
me see if I can squeeze into my schedule this week. If someone
else has some time to spare and wants to test the patch or look
into how to speed up the troublesome overload that would be
awesome.
Martin
$ let n=0; while [ $n -lt 3 ]; do time ./append-stdcxx-patched 500000000
$n; let n=`expr $n + 1`; done
std::string::append(size_type, value_type)
real 0m11.198s
user 0m10.109s
sys 0m1.036s
std::string::append(const_pointer)
real 0m2.934s
user 0m1.720s
sys 0m1.208s
std::string::append(const std::string&)
real 0m7.886s
user 0m6.724s
sys 0m1.132s
$ let n=0; while [ $n -lt 3 ]; do time LD_LIBRARY_PATH=../lib
./append-stdcxx-4.1.3 500000000 $n; let n=`expr $n + 1`; done
std::string::append(size_type, value_type)
real 0m10.425s
user 0m9.301s
sys 0m1.128s
std::string::append(const_pointer)
real 0m12.965s
user 0m11.829s
sys 0m1.132s
std::string::append(const std::string&)
real 0m8.017s
user 0m6.832s
sys 0m1.184s
$ let n=0; while [ $n -lt 3 ]; do time ./append-gcc-4.1.2 500000000 $n;
let n=`expr $n + 1`; done
std::string::append(size_type, value_type)
real 0m4.369s
user 0m3.764s
sys 0m0.604s
std::string::append(const_pointer)
real 0m4.551s
user 0m3.884s
sys 0m0.668s
std::string::append(const std::string&)
real 0m5.097s
user 0m4.412s
sys 0m0.684s
-- Mark