A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-May/014925.html below:

[Python-Dev] Comparison speed

[Python-Dev] Comparison speedAahz Maruch aahz@rahul.net
Sun, 20 May 2001 06:50:08 -0700 (PDT)
Tim Peters wrote:
> 
> If the time machine batteries can hold a full charge, you may want
> to go back and add Py_CMP as a seventh possible desired-operation
> argument to tbe rich comparison API.  My experience with dict
> comparisons was that dict_richcompare couldn't compute Py_LT/LE/GT/GE
> any cheaper than by doing a full cmp, so I put the dict oldcmp back in
> order to avoid having dict richcmp (potentially) compute cmp 3 times
> to fake one cmp.  But if dict richcmp knew a cmp outcome was desired,
> it could compute it with no extra work to speak of.  Then there would
> be no reason at all to hold on to the dict tp_compare slot.
>
> The list and tuple richcmps are also doing almost all the work needed
> to compute a 3-way cmp outcome.

+1 from me; there's one spot in my new Decimal.py where I optimize an
expensive pair of equality tests down to one by using cmp(), and it's
likely that similar cases will pop up.  When I convert to C code, I'll
want to keep doing that.
-- 
                      --- Aahz (@pobox.com)

Hugs and backrubs -- I break Rule 6       <*>       http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista

I don't really mind a person having the last whine, but I do mind
someone else having the last self-righteous whine.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4