GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-131798: JIT inline function addresses of builtin methods by kumaraditya303 · Pull Request #146906 · python/cpython Conversation
|
|
Edit: I might be wrong on the following, so please ignore the rest. Really sorry I just realised this optimization may not be sound: The builtin call specializations only check for that the builtin tp flags match, I don't think they check for tp_version_tag and such. So we can have a method that changes its tp_slots under our feet. Sorry for taking up your time! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The rewriting that we discussed might still pay off though (rewriting That should also be sound, provided we have the correct guards. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I think this is safe: let me explain why:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…3/cpython into jit-inline-funcptr
This reverts commit 0a15b1c.
There was an error while loading. Please reload this page.
|
Microbenchmark results of calling bunch of methods on each type:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Very impressive. Hopefully the site failure get fixed soon. Btw, could you please update your comment above with the final benchmark results on the current commit?
Also, from my understanding talking with Kumar, the speedup comes from removing 1 null check, and 2 dependent loads. Perhaps more importantly, the dependent loads likely then allow the CPU to prefetch the call directly, which is a pretty good speedup.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The numbers are very similar and within margin of error so keeping the existing result. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Seems like a slight win on macOS, and a slight loss on x86-64 https://github.com/facebookexperimental/free-threading-benchmarking/tree/main/results/bm-20260403-3.15.0a7+-e4a2fff-JIT |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think the benchmark runner is too noisy, for example the gc_traversal benchmark is 8% slower on linux but should be unaffected by this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.