Skip to content

gh-144888: Don't invalidate executors during function deallocation#144974

Merged
savannahostrowski merged 3 commits intopython:mainfrom
Fidget-Spinner:no_invalidate_func
Feb 19, 2026
Merged

gh-144888: Don't invalidate executors during function deallocation#144974
savannahostrowski merged 3 commits intopython:mainfrom
Fidget-Spinner:no_invalidate_func

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Feb 18, 2026

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.

Copy link
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good to me!

@savannahostrowski savannahostrowski enabled auto-merge (squash) February 19, 2026 03:20
@savannahostrowski savannahostrowski merged commit e84a2cc into python:main Feb 19, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments