-
-
Notifications
You must be signed in to change notification settings - Fork 44
Add caching to JSON schema builder #88
Copy link
Copy link
Open
Description
Hi everyone,
I am Abinash. I found that the JSON schema validator have to build the schema every single time, you try to update or insert in your table.
jsonschema::is_valid(&schema.0, &instance.0)So, I think, why not add a simple caching layer with a limit to make the schema check faster, because with a caching layer, if you insert or update millions of rows with the same JSON schema, you don't have to build the schema every single time.
Implementation can be done in a few lines of code with the help of the lru crate (https://crates.io/crates/lru). With this, the binary will only increase by 2-3%, i.e. around 50-100kb, but the performance will be doubled.
If the maintainers think this will be great for the company, I am happy to implement this feature.
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels