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-144650: support Vectorcall for _decimal.Decimal's by skirpichev · Pull Request #158207 · python/cpython Conversation
|
|
#157968 may help with the build failures (changes how the assert works which should make it better across module boundaries) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks. The Decimal is only possible candidate being a heap type in the stdlib. That was worked before in skirpichev#18 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
👍 hopefully will get more of these landed soon :). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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)
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # Modules/clinic/_testclinic.c.h
# Conflicts: # Tools/clinic/libclinic/parse_args.py
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
See also #73487 which converted many Decimal methods to vectorcall using Argument Clinic. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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. |
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 don't mind the inline keyword, it's a compiler hint that is largely ignored (which is why |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # Modules/_decimal/clinic/_decimal.c.h
|
Sorry, @cmaloney, it seems that your suggestion is not clear for me. |
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 have no preference on inline keyword or not. In this case i did some assembly looking and without the keyword it does get inlined to the _new_impl. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
#156034 (comment) was posted in August. Python changed since August, so I prefer to not rely on old benchmark numbers. It's unclear to me if #160115 (comment) include the "static inline" change or not. I would be easier for me if you can post benchmark results in this PR rather than pointing to other issues/PRs. Can you please re-run benchmarks on the latest PR version, since you just modified it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ok, done. (Same setup: default configure options, gcc 14.2.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
decimal_pi, decimal_factorial and telco benchmark results are a little bit disappointing. (Basically, there is no impact on performance, just a minor "1.01x faster" which could also just be noise in the results).
1.10x faster on a micro-benchmark is borderline interesting, but I think that adding I tested a sub-type: since import _decimal class MyDecimal(_decimal.Decimal): pass x = MyDecimal(123) |
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.