Skip to content

[Feature]: Improve performance by using a faster library for parsing json schemas #1086

Description

@mikicz

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.

Image

A bit more detail here: x.txt

Would you like to implement a feature?

None

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions