[Python-ideas] Keep free list of popular iterator objects
anthonyfk at gmail.com
Tue Sep 17 22:18:32 CEST 2013
I was able to make a build at work with freelists enabled for iterators in
dictobject.c, listobject.c and iterobject.c. When running this through our
application I saw:
1) When loading several datapoints from database: 0.1% improvement (with a
wider-but-forgotten standard deviation). So, no improvement but no ruined
performance either. Makes sense since this was mostly an I/O bound task.
2) When parsing in-memory data files: 1.5% improvement. This is
approximately what I was expecting, so far so good!
At this point I decided to run the benchmark suite Antoine pointed me to.
I also realized that I had been testing without some optimizations turned
on. I made two new builds, both with "-O3 -DNDEBUG -march=native" and
profile guided optimizations turned on. I then added a benchmark to
explicitly test tight inner loops. I ran the benchmarks and saw... a 1.02x
improvement on the benchmark I made and a 1.04x slow down on two others
(nbody, slowunpickle). I then ran our application again and confirmed that
all initial speed ups I saw were now lost in the noise.
So, thank you everyone for letting me entertain this idea, but it looks
like Raymond's hunch was right. :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas