Skip to content

gh-158934: determine if instance or class attribute specialisation is done based off the instance slot value - #158938

Open
johng wants to merge 4 commits into
python:mainfrom
johng:load-attr-null-slot-reuse
Open

johng wants to merge 4 commits into
python:mainfrom
johng:load-attr-null-slot-reuse

Conversation

@johng

@johng johng commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This ensures that we correct specialise class attribute loads even if a slot is defined but not set.

Workload A/A noise -O3: main → branch PGO+LTO: main → branch
queue.Queue put + get +0.4% 1134 → 1057 ns, −6.7% 983 → 910 ns, −7.4%
Queue producer → consumer thread −1.3% 1268 → 1192 ns, −6.0% 1142 → 1081 ns, −5.4%
with BoundedSemaphore −0.8% 852 → 807 ns, −5.4% 726 → 695 ns, −4.3%
threading.Event set + clear +0.2% 732 → 699 ns, −4.5% 629 → 609 ns, −3.1%
json.dumps tiny status dict +0.1% 1895 → 1866 ns, −1.5% 1591 → 1537 ns, −3.3%
json.dumps 10-field record −0.4% +0.8% (noise) 3592 → 3512 ns, −2.2%
json.dumps 50-record page −1.5% −0.9% −1.0%
HTTP GET + response + json.loads −1.1% +0.6% −1.9%
Future + Queue (mixed site) −0.2% −0.5% +1.3%

This ensures that we correct specialise class attribute loads
even if a slot is defined but not set.
@johng johng changed the title gh-158934: Validate instance slot for specialised attribute is NULL gh-158934: Validate instance slot for specialised attribute is not NULL Oct 6, 2026
@johng johng changed the title gh-158934: Validate instance slot for specialised attribute is not NULL gh-158934: determine if to do instance or class attribute specialisation based on the instance slot value Oct 6, 2026
@johng johng changed the title gh-158934: determine if to do instance or class attribute specialisation based on the instance slot value gh-158934: determine if instance or class attribute specialisation is done based off the instance slot value Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant