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/2009-September/091517.html below:

[Python-Dev] default of returning None hurts performance?

[Python-Dev] default of returning None hurts performance? [Python-Dev] default of returning None hurts performance?Raymond Hettinger python at rcn.com
Tue Sep 1 00:39:47 CEST 2009
> I was just wondering if a bytecode for a superinstruction of the common
> sequence:
>
> 6 POP_TOP
> 7 LOAD_CONST 0 (None)
> 10 RETURN_VALUE
>
> might be worth it.

[Collin Winter]
> I doubt it. You'd save a bit of stack manipulation, but since this
> will only appear at the end of a function, I'd be skeptical that this
> would make any macrobenchmarks (statistically) significantly faster.

I concur with Collin.  And since it appears only at the end of a function,
the optimization doesn't help inner-loops in a function (where most of
the time usually spent).


Raymond

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