Skip to content

gh-161661: json.dumps use a single dict probe for circular-reference markers - #161662

Open
aivarsk wants to merge 1 commit into
python:mainfrom
aivarsk:json-dumps-markers-setdefault
Open

aivarsk wants to merge 1 commit into
python:mainfrom
aivarsk:json-dumps-markers-setdefault

Conversation

@aivarsk

@aivarsk aivarsk commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

One less hash calculation and lookup per circular reference check.

@aivarsk
aivarsk force-pushed the json-dumps-markers-setdefault branch from 0e056ec to 7fa0231 Compare November 9, 2026 09:24
@picnixz

picnixz commented Nov 9, 2026

Copy link
Copy Markdown
Member

This adds a Py_DECREF path which may, on free-threading, introduce refcounting contention. Can you check the impact as well please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants