[Feature]: Improve performance by using a faster library for parsing json schemas
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, performance
Research direction
Start at the OpenAPI.from_file_path("") entry point and profile the JSON Schema validation path that currently uses jsonschema. Compare fastjsonschema and jsonschema-rs for compatibility and performance against the reported large OpenAPI case. Done means the selected library preserves existing validation behavior and demonstrates improved parsing time in the relevant tests or benchmark.
Written by the indexing model from the issue text.
Description
Suggested Behavior
Use fastjsonschema instead of jsonschema, or even jsonschema-rs. jsonschema-rs claims to be 30x to 390x faster than jsonschema (3x to 7x faster than fastjsonschema).
Why is this needed?
I have an OpenAPI spec that's moderately big, roughly 1.6M and parsing it with OpenAPI takes about 15s on my computer. I unfortunately can't share it, but I can share the profiling on it.
For one-time use it would be fine, but we use it in tests to validate responses, so this adds quite a bit of runtime to tests.
References
This profiling of just loading the OpenAPI yaml file, using OpenAPI.from_file_path("<path>")
The part in blue is jsonschema.
A bit more detail here: x.txt
Would you like to implement a feature?
None
- Dominant language
- Python
- Stars
- 368
- Forks
- 140
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-openapi/openapi-core
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-openapi/openapi-core#1188 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1225 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Openkind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Difficulty 3/5 1-2 days Newbie friendliness 58/100
python-openapi/openapi-core#1180 · 3 comments ·
All issues in python-openapi/openapi-core
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·