You can get a port of ptmalloc2 to win32/win64 at http://
www.nedprod.com/programs/Win32/ptmalloc2/.
ptmalloc2 is very considerably faster than the MSVC
CRT allocator in small object allocations such as those
python would frequently make. If one were to replace
python's allocator with ptmalloc2, one should expect to
see a sizeable speed increase.
As to my knowledge python extension modules don't
pass malloced blocks between themselves and the core
interpreter, there shouldn't be a problem with calling the
wrong allocator with the wrong block. However if there
were problems, ptmalloc2 allocated blocks are very
easily recognisable from MSVC allocated ones and so
the core interpreter could easily free any kind of allocated
block. The reverse, unfortunately, is not the case unless
one forced all python extension modules to use a python
provided allocator.
|