gh-144888: Don't invalidate executors during function deallocation#144974
Merged
savannahostrowski merged 3 commits intopython:mainfrom Feb 19, 2026
Merged
gh-144888: Don't invalidate executors during function deallocation#144974savannahostrowski merged 3 commits intopython:mainfrom
savannahostrowski merged 3 commits intopython:mainfrom
Conversation
savannahostrowski
approved these changes
Feb 19, 2026
Member
savannahostrowski
left a comment
There was a problem hiding this comment.
Yep, looks good to me!
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.
No optimizer/tracer pass depends on the function object. They only depend in the code object, types, module/builtin/globals dictionary, etc.
This is just additional work that slows the JIT down. It seems to manifest on bigger programs that have more executors (sympy and pylint for example).
Benchmarks: 0.6% geometric mean (0.8% mean) faster on the JIT on x86-64 Linux https://raw.githubusercontent.com/facebookexperimental/free-threading-benchmarking/refs/heads/main/results/bm-20260218-3.15.0a6%2B-170839d-JIT/bm-20260218-vultr-x86_64-Fidget%252dSpinner-no_invalidate_func-3.15.0a6%2B-170839d-vs-base.svg
We discussed this over the JIT weekly sync, and we agreed to remove it.
Also, apparently, I added this in the initial tracing JIT frontend PR in 3.15. Prior to that, the JIT never had invalidation for function deallocation! So that bolsters my confidence in removing this.