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 StyXman, neologix, vstinner, ztane
Date 2016-04-11.14:29:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460384945.46.0.55942539388.issue26601@psf.upfronthosting.co.za>
In-reply-to
Content
> ... and it turns out that munmapping is not always that smart thing to do: http://stackoverflow.com/questions/36548518/variable-assignment-faster-than-one-liner

py -3 -m timeit "tuple(range(2000)) == tuple(range(2000))"
10000 loops, best of 3: 97.7 usec per loop
py -3 -m timeit "a = tuple(range(2000));  b = tuple(range(2000)); a==b"
10000 loops, best of 3: 70.7 usec per loop

Hum, it looks like this specific benchmark spends a lot of time to allocate one arena and then release it.

Maybe we should keep one "free" arena to avoid the slow mmap/munmap. But it means that we keep 256 KB of unused memory.

Maybe we need an heuristic to release the free arena after N calls to object allocator functions which don't need this free arena.
History
Date User Action Args
2016-04-11 14:29:05vstinnersetrecipients: + vstinner, StyXman, neologix, ztane
2016-04-11 14:29:05vstinnersetmessageid: <1460384945.46.0.55942539388.issue26601@psf.upfronthosting.co.za>
2016-04-11 14:29:05vstinnerlinkissue26601 messages
2016-04-11 14:29:05vstinnercreate