gh-143421: Lazily allocate tracer code and opt buffers#143597
gh-143421: Lazily allocate tracer code and opt buffers#143597Fidget-Spinner merged 2 commits intopython:mainfrom
Conversation
|
Should we remove the newly added |
Let's keep it. It's a good refactor. |
| // Holds locals, stack, locals, stack ... co_consts (in that order) | ||
| #define MAX_ABSTRACT_INTERP_SIZE 4096 | ||
| // Holds locals, stack, locals, stack ... (in that order) | ||
| #define MAX_ABSTRACT_INTERP_SIZE 512 |
There was a problem hiding this comment.
This number was picked arbitrarily by me back then when I first wrote this. I now realise it's overkill. We don't need 3 pages of memory just to store locals and stack. It's slow and wastes memory.
|
This makes no sense to me. How is allocating the necessary memory piecemeal faster than allocating it in a single chunk? |
|
@markshannon no the problem was embedding it as a part of |
|
The benchmark doesn't run any work to use the JIT, instead it just measures thread startup overhead https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_concurrent_imap/run_benchmark.py#L19 Embedding the two structs together in the |
|
It shouldn't be embedded, it should be heap allocated as one |
Ok let me just put a up a PR to do that. |
I verified on my system this restores the old performance.