Retain raw performance using internal C Function#245
Conversation
for more information, see https://pre-commit.ci
…le at the moment.
for more information, see https://pre-commit.ci
|
Seems except ImportError:
pytestmark = pytest.mark.skip("pytest_codspeed needs to be installed") |
|
@aiolibsbot review |
|
Too tired to give it a pass tonight but asked the bot to take a look in case it can same some human cycles |
PR Review — Retain raw performance using internal C FunctionThe reference-counting bug flagged in the earlier review is fixed in this revision: on a cache miss the function returns the 🟡 Important1. Validate the performance premise; comment misattributes #244 (`src/propcache/_helpers_c.pyx`, L7-8)First, the good news: this revision's refcounting now looks correct. The miss path returns the The remaining question is whether the change earns its keep. CodSpeed reports 'will not alter performance' with 4 untouched benchmarks, so the stated goal — retain raw performance — is not demonstrated by any measurement. The inline comment here ( 2. No tests added; existing refcount tests can't catch a constant-offset leak (`src/propcache/_helpers_c.pyx`, L44-50)The checklist says 'Unit tests for the changes exist,' but the diff adds none. Two concrete gaps:
🟢 Suggestions1. Prefer a real .h file over C embedded in a Cython verbatim docstring (`src/propcache/_helpers_c.pyx`, L5-6)Embedding the function body inside the 2. Hit path has a borrowed-ref race under the free-threaded build (`src/propcache/_helpers_c.pyx`, L41-42)The module declares 3. Changelog: 'it's' -> 'its', and 'bugfix' classification is questionable (`CHANGES/245.bugfix.rst`, L1-3)Two nits: (1) Checklist
SummaryThe reference-counting bug flagged in the earlier review is fixed in this revision: on a cache miss the function returns the To rebase specific severity levels, mention me: Automated review by Kōanebca276 |
The coverage drop you're seeing is just the environmental The more important testing point: the existing |
Bottom line so you can triage quickly: there's one blocking issue. The new C CI is green because the Fix is one line of logic: |
|
code coverage in the pypy section seems the be the culprit with this PR's workflows not passing. Someone is going to need to look into fixing that a bit later. |
The mechanism behind the coverage drop: when |
One thing worth noting for triage: in |
@bdraco Any thoughts on omitting |
There was a problem hiding this comment.
No imperative mood and no period before the em dash plz.
There was a problem hiding this comment.
Are my changes much improved now?
Retain raw performance of propcache by moving critical sections to C
-- by :user:`Vizonex`.
What do these changes do?
These changes attempt to retain the raw performance of propcache's
under_cached_propertyclass by using a C function instead of a Cython one.which is a low level packer/sender tool that filters keyword arguments out of a function before sending allowing for higher level callback customization. Though that project seeks to move entirely to C, it stores all of it's critical functions in the header file to help retain it's raw performance, this concept is what I'm seeking to try and do with propcache to give it the same boost.
Feel free to let me know if you want me to give the other class
cached_propertythe same treatmet.Are there changes in behavior for the user?
Related issue number
Edit: This does not close 244 as 244 is a workflow concurrency issue. Yes I'm noticing it on my libraries also.
Checklist