Repository navigation
gh-144650: support Vectorcall for _decimal.Decimal's - #158207
skirpichev wants to merge 13 commits into
Conversation
325c126 to
a0723f1
Compare
|
#157968 may help with the build failures (changes how the assert works which should make it better across module boundaries) |
|
Thanks. The Decimal is only possible candidate being a heap type in the stdlib. That was worked before in skirpichev#18 |
|
👍 hopefully will get more of these landed soon :). |
Convert the static types to heap types. Move empty init vectorcall to share with existing no-arg __init__ case. Add support for no-argument vectorcall so the no-arg __init__ cases actually work (rather than adding an arg). Produce the same error string as the PyArg helpers do. The vectorcall types no longer have a C address for the generated `Py_Is` so instead compare the slot function instead. This drops the requirement that a class using vectorcall declare a type object. Co-Authored-By: Claude Fable 5.1 <[email protected]> (cherry-picked from python#157968)
# Conflicts: # Modules/clinic/_testclinic.c.h
|
Did you close it because you consider that it's not worth it? |
|
I think it still worth it, assuming micro-benchmarks. It's for free, anyway. But it's on top of #157968. If you are ok, I'll reopen this one that pr (or some its alternative) will be merged. |
# Conflicts: # Tools/clinic/libclinic/parse_args.py
vstinner
left a comment
There was a problem hiding this comment.
Benchmark results were posted 1 month ago, but the PR changed in the meanwhile. Would it be possible to re-run benchmarks on the latest PR version?
| an exact conversion. If the result does not meet the restrictions | ||
| for an mpd_t, fail with InvalidOperation. */ | ||
| static PyObject * | ||
| static inline PyObject * |
There was a problem hiding this comment.
Is it useful to mark the function as "inline"? Does it impact performance?
|
See also #73487 which converted many Decimal methods to vectorcall using Argument Clinic. |
In fact, you can see that benchmarks already updated. Not so much, as before. #156034 shows better numbers. Now included telco benchmark.
This is something that was suggested in #160115. You can compare my previous benchmark run. IMO, the difference looks more or less as a noise: Not sure if this worth reversion. That function used only once, anyway. |
|
I don't mind the inline keyword, it's a compiler hint that is largely ignored (which is why |
This shows almost no effect on "official" pyperformance benchmarks (see python/pyperformance#473):
But on micro-benchmarks it show some speedup:
(Default ./configure options, gcc 14.2)
Details