dictionary.update() enhancement?

Erik Max Francis max at alcyone.com
Fri Oct 12 19:52:25 EDT 2001


Mark J wrote:

> Mark J wrote:
>
> >> Because it's not as straight-forward as saying d.update(other,
> >> collision_handler) and it's about 10 times slower.
> 
> Erik Max Francis <max at alcyone.com> wrote:
>
> > Ten times slower?  What in the world gives you that idea?
>
> Try it:

That is among the silliest tests I've ever seen.  The current behavior
does _not_ do collision testing, and so you're not comparing manual
collision testing with your proposed collision testing, you're comparing
manual collision testing with _nothing_.  Of _course_ it's slower, but
that doesn't mean that your proposed method would be any faster.

Your proposal would have to call out to the provided Python collision
handler function, which is going to be the bottleneck, and so it is
highly unlikely to be significantly faster.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Don't overestimate the decency of the human race.
\__/ H.L. Mencken
    Erik Max Francis' bookmarks / http://www.alcyone.com/max/links/
 A highly categorized list of Web links.



More information about the Python-list mailing list