Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-37029: keep usable_arenas in sorted order without searching#13612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tim-one merged 5 commits intopython:masterfromtim-one:remove-arena-search
Jun 1, 2019

Conversation

tim-one
Copy link
Member

@tim-onetim-one commentedMay 28, 2019
edited by bedevere-bot
Loading

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

Copy link
Member

@pitroupitrou left a 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.

@@ -1172,6 +1189,9 @@ static struct arena_object* unused_arena_objects = NULL;
*/
Copy link
Member

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?

Copy link
MemberAuthor

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 themain explanation of arenas lives (look at the comment block aboutusable_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.

@tim-onetim-one merged commit1c263e3 intopython:masterJun 1, 2019
@bedevere-bot
Copy link

@tim-one: Please replace# withGH- in the commit message next time. Thanks!

@tim-onetim-one deleted the remove-arena-search branchJune 1, 2019 02:30
DinoV pushed a commit to DinoV/cpython that referenced this pull requestJan 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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@pitroupitroupitrou left review comments

@methanemethanemethane approved these changes

Assignees

@tim-onetim-one

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@tim-one@bedevere-bot@methane@pitrou@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp