Michael Matz wrote:
Hi Josef,
On Tue, 22 Apr 2008, jreidinger@svn.opensuse.org wrote:
Author: jreidinger Date: Tue Apr 22 12:07:08 2008 New Revision: 9774
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9774&view=rev Log: move replace_all to zypp and change inplace replace to gsub, which have better performance
Your own testcase said something else:
zypper gsub boost user time: 769 system time: 0 jano replace_all boost user time: 689 system time: 0 boost replace_all boost user time: 8626 system time: 6
gsub is slower. That's also expected, as it needs to copy the whole string.
Ciao, Michael.
I post it in another note about performance of different string size to replace, which I before forget send. In zypper is replaced '\n' for some ' ' (not exactly set how many). testcase when to and from have different size: zypper gsub boost user time: 817 system time: 1 jano replace_all boost user time: 830 system time: 0 -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org