[Yum-devel] [PATCH] Fix main speed issue in to_xml(), slows down new createrepo a lot. BZ 716235.
James Antill
james at fedoraproject.org
Thu Nov 15 20:58:57 UTC 2012
On Thu, 2012-11-15 at 11:02 -0800, Toshio Kuratomi wrote:
> This function has always made me cringe. It's riddled with false
> assumptions.
Yeh, thanks for fixing it :). And thanks Zdenek for reviewing my
initial hack (my thought was that if the caller already did unicode() it
skipped all the junk, so might as well skip it when we convert).
Anyway...
[...]
> I then removed the additional flexibility that the code had and pushed it
> into the yum.misc file as a replacement for _ugly_utf8_string_hack() and
> to_xml(). Benchmarking that was marginally faster than the code with the
> patches suggested here (once again, with greater variance between the test
> runs than between the different versions of the code).
So I initially just tried the patch and got a time of 6:14 ... which
seemed pretty bad compared to the initial 1:25, 0:33 after my hack and
even with a super version of Zdenek's fix (translating in all code
paths) of 0:48.
But trying to see why didn't show anything and then I added:
item = to_utf8(item)
...before the call to saxutils, as we do now. That gave a time of 0:37,
so ... news at 11 all xml libs. suck all the time.
> I'll attach the patch for the kitchen-derived code and you can look for
> flaws.
If you want to alter your patch to do the above to_utf8(), and either
import itertools (or just use map() :). ACK.
More information about the Yum-devel
mailing list