| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I don't think LOAD_COMMON_CONST is safe right now, since users could have messed with the builtins module. Probably better to stash the funcs in interp->callable_cache like other builtins used for optimisation? |
Sorry, something went wrong.
There was a problem hiding this comment.
Very cool! Any plans to do this for set or list?
dict/max/min/sum are trickier, but may be worth exploring too.
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
Sorry, something went wrong.
|
This should fix the JIT builds: diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py
index aa2b56abf44..73a4210eee0 100644
--- a/Tools/jit/_targets.py
+++ b/Tools/jit/_targets.py
@@ -522,7 +522,14 @@ def get_target(host: str) -> _COFF | _ELF | _MachO:
args = ["-fms-runtime-lib=dll"]
target = _COFF(host, args=args)
elif re.fullmatch(r"x86_64-.*-linux-gnu", host):
- args = ["-fno-pic", "-mcmodel=medium", "-mlarge-data-threshold=0"]
+ args = [
+ # Jump tables generate R_X86_64_32S relocations, which assume a
+ # signed 32-bit address space:
+ "-fno-jump-tables",
+ "-fno-pic",
+ "-mcmodel=medium",
+ "-mlarge-data-threshold=0",
+ ]
target = _ELF(host, args=args)
else:
raise ValueError(host) |
Sorry, something went wrong.
|
The overall approach looks good. Do you have stats for this PR? |
Sorry, something went wrong.
The latter three would be nice wins. |
Sorry, something went wrong.
|
Perf results are here: https://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20250326-3.14.0a6%2B-50dd66b/README.md |
Sorry, something went wrong.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
|
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good. You can revert the JIT change, it's not needed anymore.
(Also I'm running JIT benchmarks just because I'm curious, but no need to block on those results at all.)
Sorry, something went wrong.
| #include "pycore_warnings.h" // _PyErr_WarnUnawaitedCoroutine() | ||
|
|
||
|
|
||
| #include "opcode_ids.h" // RESUME, etc |
There was a problem hiding this comment.
Is this needed?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I had to remove this include from another header so it needs to be included when needed.
Sorry, something went wrong.
|
(Also, I think you need to make regen-cases.) |
Sorry, something went wrong.
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
## Summary Closes #12912 by only applying the tuple generator behavior of the rule on Python 3.14+, where tuple generator expression got optimized in (ref: python/cpython#131737). Rendering the concerns on that issue no longer relevant on those Python versions. This was especially problematic for `C409` as only some behaviour is in preview, not the rule itself, so you couldn't use `tool.ruff.lint.explicit-preview-rules = true` ## Test Plan New snapshot should pass on CI --- Note: Code changed by Claude Sonnet 4.6. Reviewed by human, although I don't know much about Rust (but this seems a simple enough change)
| Back | FazBrowse Home | New Git URL |
This PR implements the optimization described in faster-cpython/ideas#545.