GeezerVison is showing github.com — bpo-37029: keep usable_arenas in sorted order without searching by tim-one · Pull Request #13612 · python/cpython
Conversation
tim-one
commented
May 28, 2019
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
This adds a vector of "search fingers" so that usable_arenas can be kept in sorted order (by number of free pools) via constant-time operations instead of linear search.
This should reduce worst-case time for reclaiming a great many objects from O(A**2) to O(A), where A is the number of arenas.
https://bugs.python.org/issue37029
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
sorted by number of free pools.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks neat, just a comment.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -1172,6 +1189,9 @@ static struct arena_object* unused_arena_objects = NULL; |
|
|
*/
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment documenting that they are sorted in number of free pools?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not, unless you feel strongly about it. This has been documented all along, but up where the main explanation of arenas lives (look at the comment block about usable_arenas at line 1150).
There are a bunch of moving parts here, and the style of the file is to give long-ish English explanations in uninterrupted comment blocks, with only the briefest of memory-jogging comments on declaration lines.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@tim-one: Please replace # with GH- in the commit message next time. Thanks!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
DinoV
pushed a commit
to DinoV/cpython
that referenced
this pull request
Jan 14, 2020
…on#13612)
This adds a vector of "search fingers" so that usable_arenas can be kept in sorted order (by number of free pools) via constant-time operations instead of linear search.
This should reduce worst-case time for reclaiming a great many objects from O(A**2) to O(A), where A is the number of arenas. See bpo-37029.
Reviewers
pitrou
pitrou left review comments
methane
methane approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|