feat: use pre-compiled ajv validators at runtime - #141
Merged
Merged
Conversation
this builds on the speed up from memorizing the validator in #140, further improving the speed of the zod spec file from `~1s` -> `~200ms` (a lot better than the original `~6s`!) there's no longer any need to memorize the validator, since the require cache effectively does this for us now. the compiled validation function is pretty large, but committing it will keep me honest and prove reproducibility thanks to the CI check for uncommitted changes after running the build / tests.
mnahkies
enabled auto-merge (squash)
April 6, 2024 11:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this builds on the speed up from memorizing the validator in #140,
further improving the speed of the zod spec file from
~1s->~200ms(a lot better than the original
~6s!)(though note, it's a bit of a wash for time in CI given it re-compiles there)
there's no longer any need to memorize the validator, since the require
cache effectively does this for us now.
the compiled validation function is pretty large, but committing it
will keep me honest and prove reproducibility thanks to the CI check
for uncommitted changes after running the build / tests.