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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to