Skip to content

perf(json): convert values by type and build response objects without a hash map - #664

Open
patrick-immometrica wants to merge 3 commits into
0x676e67:mainfrom
patrick-immometrica:perf/response-json
Open

patrick-immometrica wants to merge 3 commits into
0x676e67:mainfrom
patrick-immometrica:perf/response-json

Conversation

@patrick-immometrica

@patrick-immometrica patrick-immometrica commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Python values in JSON bodies, query strings and form data are now converted by checking their type first (str, bool, int, float, None, dict, list/tuple), where before each variant was tried in turn until one worked. JSON objects in responses are stored as a plain list of key/value pairs instead of a hash map, and one buffer is shared while the whole response is parsed, which saves the per-object hashing and allocations before the result becomes a Python dict. A new test in tests/request_test.py sends every value type to a local server and checks the exact bytes, so the output stays the same.

@patrick-immometrica patrick-immometrica changed the title Perf/response json perf(json): convert values by type and build response objects without a hash map Nov 8, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant