Issue 45522: Allow to build Python without freelists
Created on 2021-10-19 11:06 by christian.heimes, last changed 2022-04-11 14:59 by admin.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 29056 | merged | christian.heimes, 2021-10-19 11:21 | |
| PR 29086 | closed | christian.heimes, 2021-10-20 07:16 | |
| Messages (6) | |||
|---|---|---|---|
| msg404289 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2021-10-19 11:06 | |
Freelists are an optimization trick to avoid allocation and deallocation of commonly used structures. Currently Python has freelists for frame, tuple, float, list, dict, async generators, and context objects. Small ints are also cached. For experimentation with alternative memory allocators such as mimalloc, I would like to introduce a way to disable freelists. Tuples's _Py_tuple_state struct has a conditional check on #if PyTuple_MAXSAVESIZE > 0. I propose to add same logic to all other structs. |
|||
| msg404599 - (view) | Author: miss-islington (miss-islington) | Date: 2021-10-21 13:12 | |
New changeset 9942f42a93ccda047fd3558c47b822e99afe10c0 by Christian Heimes in branch 'main': bpo-45522: Allow to disable freelists on build time (GH-29056) https://github.com/python/cpython/commit/9942f42a93ccda047fd3558c47b822e99afe10c0 |
|||
| msg405207 - (view) | Author: Mark Shannon (Mark.Shannon) * ![]() |
Date: 2021-10-28 17:25 | |
I think we should revert this. It just makes working with freelists more cumbersome. Having more configure options just makes it more likely that we will fail to test some configuration. If you want to disable freelists in your experiments, feel free to do so, but it doesn't need to be in main, IMO. |
|||
| msg405293 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2021-10-29 09:00 | |
Which part of the patch is causing you extra work? Would you be fine if I only remove the configure option and leave the fixes for zero-length freelists (#define PyList_MAXFREELIST 0) in? |
|||
| msg410614 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2022-01-15 00:36 | |
> Freelists for object structs can now be disabled. A new configure option --without-freelists can be used to disable all freelists except empty tuple singleton. (Contributed by Christian Heimes in bpo-45522) Can you please document the new configuration option in https://docs.python.org/dev/using/configure.html ? When you write :option:`--without-freelists` in what's new in Python 3.11 to get a link ;-) |
|||
| msg410778 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2022-01-17 13:14 | |
I reopen the issue to not forget to complete the doc. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:51 | admin | set | github: 89685 |
| 2022-01-17 13:14:15 | vstinner | set | status: closed -> open resolution: fixed -> messages: + msg410778 |
| 2022-01-15 00:36:22 | vstinner | set | nosy:
+ vstinner messages: + msg410614 |
| 2021-10-29 09:00:25 | christian.heimes | set | messages: + msg405293 |
| 2021-10-28 17:25:05 | Mark.Shannon | set | nosy:
+ Mark.Shannon messages: + msg405207 |
| 2021-10-21 13:12:53 | christian.heimes | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2021-10-21 13:12:29 | miss-islington | set | nosy:
+ miss-islington messages: + msg404599 |
| 2021-10-20 07:16:00 | christian.heimes | set | pull_requests: + pull_request27352 |
| 2021-10-19 11:21:45 | christian.heimes | set | keywords:
+ patch pull_requests: + pull_request27327 |
| 2021-10-19 11:06:04 | christian.heimes | create | |
