[Python-Dev] Tuning Python dicts

Daniel Stutzbach daniel at stutzbachenterprises.com
Tue Apr 13 18:12:47 CEST 2010


On Sat, Apr 10, 2010 at 1:06 PM, Reid Kleckner <rnk at mit.edu> wrote:

> Looking at dictnotes.txt, I can see that people have experimented with
> taking advantage of cache locality.  I was wondering what benchmarks
> were used to glean these lessons before I write my own.  Python
> obviously has very particular workloads that need to be modeled
> appropriately, such as namespaces and **kwargs dicts.
>

I don't know what benchmarks were used to write dictnotes.txt, but moving
forward I would recommend implementing your changes on trunk (i.e., Python
2.x) and running the Unladen Swallow Benchmarks, which you can get from the
link below:

http://code.google.com/p/unladen-swallow/wiki/Benchmarks

They are macro-benchmarks on real applications.  You will probably also want
to write some micro-benchmarks of your own so that you can pinpoint any
bottlenecks in your code and determine where you are ahead of the current
dict implementation and where you are behind.
--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100413/87467406/attachment.html>


More information about the Python-Dev mailing list