Mailinglist Archive: zypp-devel (226 mails)

< Previous Next >
Re: [zypp-devel] Re: [zypp-commit] r9774 - /trunk/zypper/src/zypper-utils.cc
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Tue, 22 Apr 2008 17:04:26 +0200
  • Message-id: <480DFE7A.5080500@xxxxxxx>
Michael Matz wrote:
Hi Josef,

On Tue, 22 Apr 2008, jreidinger@xxxxxxxxxxxxxxxx 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@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References