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/2011-May/111587.html below:

storing reference counters outside of objects

[Python-Dev] CPython optimization: storing reference counters outside of objects [Python-Dev] CPython optimization: storing reference counters outside of objectsArtur Siekielski artur.siekielski at gmail.com
Mon May 23 22:55:21 CEST 2011
Ok, I managed to make a quick but working patch (sufficient to get
working interpreter, it segfaults for extension modules). It uses the
"ememoa" allocator (http://code.google.com/p/ememoa/) which seems a
reasonable pool allocator. The patch: http://dpaste.org/K8en/. The
main obstacle was that there isn't a single function/macro that can be
used to initialize all PyObjects, so I had to initialize static
PyObjects (mainly PyTypeObjects) by hand.

I used a naive quicksort algorithm as a benchmark:
http://dpaste.org/qquh/ . The result is that after patching it runs
50% SLOWER. I profiled it and allocator methods used 35% time. So
there is still 15% performance loss even if the allocator is poor.

Anyway, I'd like to have working copy-on-write in CPython - in the
presence of GIL I find it important to have multiprocess programs
optimized (and I think it's a common idiom that a parent process
prepares some big data structure, and child "worker" processes do some
read-only quering).

Artur
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