[Yum-devel] str_eq within yum (and kitchen)

David Malcolm dmalcolm at redhat.com
Tue Aug 24 22:28:06 UTC 2010


Profiling of a Fedora 14 "yum install *" showed it spending 80 seconds
out of 274 within its implementation of "str_eq" (24 million calls), so
optimizing this seems worthwhile.

One possibility is to hand-optimize this in C, or use Cython.

As a first step, attached are some more selftests for kitchen's [1]
implementation of this function, to try to better capture some of the
expected behavior.


What's the expected behavior, if any, of passing in objects that aren't
str or unicode?

e.g. passing in a float
>>> str_eq(0.1, 0.1)
True

Is it acceptable if, say it, raises a TypeError instead?

Do you need support for objects that are derived from str/unicode as
well as those specific classes?

Hope this is helpful
Dave

[1] https://fedorahosted.org/kitchen/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_str_eq.patch
Type: text/x-patch
Size: 1480 bytes
Desc: not available
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100824/98db19c6/attachment.bin>


More information about the Yum-devel mailing list