GH-100240: Generic freelist, applied to ints#101453
Conversation
markshannon
left a comment
There was a problem hiding this comment.
I know this is a draft, but I've taken the liberty of reviewing anyway 🙂
Sorry, something went wrong.
|
benchmarks are showing this as 2% slower overall. I guess we need to tune it. https://github.com/faster-cpython/benchmarking/tree/main/results/bm-20230131-3.12.0a4%2B-fe65f49 |
Sorry, something went wrong.
|
It looks like this PR is allocating from the freelist, but freeing to the underlying allocator in the specialized |
Sorry, something went wrong.
|
I see you've added stats, have you recorded the stats yet? |
Sorry, something went wrong.
Not yet. I have a bug I'm trying to figure out. It crashes in tests that use subprocesses. |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
test_embed is failing because of a leak (I'll check why). The other tests pass. |
Sorry, something went wrong.
The leak was because an int was freed and inserted to the freelist after it has been cleared in interpreter_clear. I set space and capacity to 0 in interpreter_clear to prevent this. |
Sorry, something went wrong.
|
Dropping this for now. |
Sorry, something went wrong.
@markshannon This is basically the freelist from your branch, made a bit more generic, and applied to ints. We should think about which sizes we want to include.
(I'm trying to run benchmarks, but there is some issue with the machine at the moment).