Do not use static type references when compiling for RustPython#5995
Do not use static type references when compiling for RustPython#5995bschoenmaeckers wants to merge 2 commits intoPyO3:mainfrom
RustPython#5995Conversation
87e669a to
391626b
Compare
391626b to
583b78d
Compare
655b9a3 to
91658f1
Compare
91658f1 to
a136b15
Compare
Merging this PR will improve performance by 13.8%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | bench_pyclass_create |
4.6 µs | 4 µs | +13.8% |
Comparing bschoenmaeckers:RustPython-type-statics (e8b2d31) with main (8a00673)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
| } | ||
|
|
||
| extern_libpython! { |
There was a problem hiding this comment.
There are a number of places in this PR where the extern blocks can be merged with one immediately above / below.
(I wonder if we could / should write a lint for that, maybe as part of the recently added machinery in the noxfile for formatting these?)
There was a problem hiding this comment.
I've merged most adjacent blocks where the cfg attributes where the same. Please let me know I you see an other spot that needs cleaning.
Removed all usage of static type pointers when compiling for RustPython. Diff is large but is very repetitive.
Test plan
xref RustPython/RustPython#7562
https://discuss.python.org/t/c-api-add-py-getbuildintype-and-py-getbuildintypeborrowed/107010