[MERGE] add performance three

Robert Collins robertc at robertcollins.net
Tue May 23 00:08:38 BST 2006


On Mon, 2006-05-22 at 07:25 -0500, John A Meinel wrote:
> Robert Collins wrote:
> > This makes add faster again by using the inventory objects and by
> > tweaking the elementree xml serialiser to be faster in the inner loop.
> > 
> > Rob
> > 
> 
> ...
> 
> > +
> > +
> > +# before in bench_add_kernel_like
> > +# 10831        10824   9384.4890   1847.5270   elementtree.ElementTree:662(_write)
> > +#+10824            0   9295.0140   1761.0460   +elementtree.ElementTree:662(_write)
> > +#+32471            0   4585.8950   1331.2060   +elementtree.ElementTree:812(_escape_attrib)
> > +#after switching to text.replace rather than string.replace.
> > +# 10831        10824   7486.1120   1832.2340   elementtree.ElementTree:662(_write)
> > +#+10824            0   7397.3120   1745.6300   +elementtree.ElementTree:662(_write)
> > +#+32471            0   2762.3760   1300.3990   +bzrlib.xml_serializer:85(_escape_attrib)
> > +
> 
> Is this comment correct? From what I can see, you are switching to
> re.sub() rather than string.replace(). Not switching to text.replace().

Thanks. I actually didn't mean to commit those stats. The first thing I
tried was text.replace, which was *much* faster than string.replace, but
slower than the regexp.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060523/d8a794c0/attachment.pgp 


More information about the bazaar mailing list