gh-144888: Replace bloom filter linked lists with continuous arrays to optimize executor invalidating performance#145873
Open
cocolato wants to merge 2 commits intopython:mainfrom
Open
gh-144888: Replace bloom filter linked lists with continuous arrays to optimize executor invalidating performance#145873cocolato wants to merge 2 commits intopython:mainfrom
cocolato wants to merge 2 commits intopython:mainfrom
Conversation
markshannon
reviewed
Mar 12, 2026
Member
markshannon
left a comment
There was a problem hiding this comment.
Thanks for doing this.
I've only had time to do a quick scan, but this looks like it should speed up the scan considerably.
| _PyBloomFilter bloom; | ||
| _PyExecutorLinkListNode links; | ||
| int32_t bloom_array_idx; // Index in interp->executor_blooms/executor_ptrs. | ||
| _PyExecutorLinkListNode links; // Used by deletion list. |
Member
There was a problem hiding this comment.
Is this necessary now? We can traverse all executors using the executor_ptrs array.
Contributor
Author
There was a problem hiding this comment.
I think we need it to save deletion list:
Lines 332 to 338 in 08a018e
Contributor
Author
|
@Fidget-Spinner gentle ping, if you have time ,please take a look at this, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
During JIT compilation, when function objects are destroyed or code objects are modified, all executors must be traversed to inspect their dependencies, followed by invalidating the relevant executors. The original implementation stored executors using singly linked lists, resulting in numerous pointer jumps during traversal and consequently poor CPU cache efficiency.
This PR changes the executor storage structure from a linked list to a contiguous array, reducing pointer jumps during traversal to improve CPU cache efficiency. It also implements O(1) deletion using swap-remove, thereby accelerating dependency invalidation operations.