This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients rhettinger, serhiy.storchaka, vstinner, yselivanov
Date 2016-01-31.17:48:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za>
In-reply-to
Content
The issue #23601 showed speedup for the dict type by replacing PyMem_Malloc() with PyObject_Malloc() in dictobject.c.

When I worked on the PEP 445, it was discussed to use the Python fast memory allocator for small memory allocations (<= 512 bytes), but I think that nobody tested on benchmark.

So I open an issue to discuss that.

By the way, we should also benchmark the Windows memory allocator which limits fragmentations. Maybe we can skip the Python small memory allocator on recent version of Windows?

Attached patch implements the change. The main question is the speedup on various kinds of memory allocations (need a benchmark) :-)

I will try to run benchmarks.

--

If the patch slows down Python, maybe we can investigate if some Python types (like dict) mostly uses "small" memory blocks (<= 512 bytes).
History
Date User Action Args
2016-01-31 17:48:24vstinnersetrecipients: + vstinner, rhettinger, serhiy.storchaka, yselivanov
2016-01-31 17:48:24vstinnersetmessageid: <1454262504.41.0.628053130208.issue26249@psf.upfronthosting.co.za>
2016-01-31 17:48:24vstinnerlinkissue26249 messages
2016-01-31 17:48:23vstinnercreate