[Yum-devel] [PATCH] clean up misc.to_xml(), make it faster, add tests. BZ 716235.
James Antill
james at fedoraproject.org
Fri Nov 16 17:38:25 UTC 2012
On Fri, 2012-11-16 at 12:17 -0500, Zdenek Pavlas wrote:
> > replacing and killing of bad bytes with a single call to item.translate()
>
> Tried that, too. unicode.replace(dict) is surprisingly slow.
> With the same test case, this scored some 0.180s
Interesting, assuming you mean unicode.translate. I kind of assumed the
multiple replaces would be slower than a single translate.
Anyway I added the extra apos replace (but changed nothing else) and
the degenerate package testcase of:
time python -c 'import yum; x = yum.YumBase();
x.pkgSack.returnPackages(patterns=["widelands"])[0].xml_dump_filelists_metadata()
...was 1.156 vs. 1.054 for Toshio's version (with the to_utf8 in it).
But, for the complete createrepo run I got 32.407 which is better than
37.253 :)
So I have no complaints with doing it all "in python" :)
More information about the Yum-devel
mailing list