[Python-Dev] Microsoft speedup

Tim Peters tim_one@email.msn.com
Fri, 9 May 2003 00:17:59 -0400


[Duncan Booth]
> I was just playing around with the compiler options using
> Microsoft VC6 and
> I see that adding the option /Ob2 speeds up pystone by about 2.5%
> (/Ob2 is the option to automatically inline functions where the compiler
> thinks it is worthwhile.)
>
> The downside is that it increases the size of python23.dll by about 13%.
>
> It's not a phenomenal speedup, but it should be pretty low impact if the
> extra size is considered a worthwhile tradeoff.

I want to see much broader testing first.  A couple employers ago, we
disabled all magical inlining options, because sometimes they made critical
loops faster, and sometimes slower, and you couldn't guess which as the code
changed, and in that problem domain (speech recognition) the critical loops
were truly critical so we were acutely aware of compiled-code speed
regressions.  So I'm not discouraged <wink> that pystone sped up when you
tried it, but not particularly encouraged either.

I expect it's more worth trying in Python, as hardly any code in Python goes
three lines without a function call or conditional branch.