A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-January/059811.html below:

[Python-Dev] basenumber redux

[Python-Dev] basenumber redux"Martin v. Löwis" martin at v.loewis.de
Tue Jan 17 07:46:17 CET 2006
Raymond Hettinger wrote:
> Are you sure?  The former has two builtin lookups (which also entail two
> failed global lookups), a function call, and a test/jump for the result.
> The latter approach has no lookups (just a load constant), a try-block
> setup, an add operation (optimized for integers, a fast slot lookup
> otherwise), and a block end.
> 
> Even if there were a performance edge, I suppose that the type checking
> is the time critical part of most scripts.

My guess is that it depends on the common case. If the common case is
that the type test fails (i.e. element-wise operations are the
exception), then you also have the exception creation and storing
in the exception approach, compared to returning only existing objects
in the type test case. If the common case is that x+0 succeeds, x+0
may or may not create new objects.

However, I have long ago learned not to guess about performance, so
I won't do further guessing until I see the actual code.

Regards,
Martin
More information about the Python-Dev mailing list

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