Python IS slow ! [was] Re: Python too slow for real world

Markus Kohler markus_kohler at hp.com
Thu May 6 08:15:11 EDT 1999


Christian Tismer wrote:
> 
> Hi Guys, I think we are missing something
> 
> Markus Kohler wrote:
> >
> > Fredrik Lundh wrote:
> > >
> > > Markus Kohler wrote:
> > > > > GvR:
> > > > > Also, it allocates each stack frame as a separate object.
> > > > > So that's at least two memory allocation/free operations
> > > > > per procedure call.
> ...
> > > iirc, the self people discovered that two optimizations
> > > dominated everything:
> > >
> > > -- method and block in-lining
> ...
> > > -- call-site caching
> 
> This is all wonderful stuff. But I think we are
> missing one point, and if I didn't go completely nuts
> last night, there might be some fairly low hanging
> fruit which could save 30% of runtime, at least speaking of NT.
> 
> After Markus' recommendation, I loaded a trial version of
> Visual Quantify, a tool for timing of compiled code.
> This tool works with optimized code very well, finds
> every system call and so on.
> 
> I configured Quantify to ignore all .dll files but python15.dll
> and msvcrt.dll, to get an idea where the core spends
> most of its time.
> 
> Test 1: Running python.exe with the commandline
> -c "from test.pystone import *;map (lambda x:main(), range(10))"
> 
> Result time: 22.36% malloc, 14.35% free.
> 

Running pystone on HP-UX the result for 1.5.2c is 3.37% for malloc and
3.95%
for free :-(


Markus

-- 
Markus Kohler  mailto:markus_kohler at hp.com




More information about the Python-list mailing list