Skip to content

feat: use pre-compiled ajv validators at runtime - #141

Merged
mnahkies merged 4 commits into
mainfrom
mn/feat/pre-compile-validator
Apr 6, 2024
Merged

mnahkies merged 4 commits into
mainfrom
mn/feat/pre-compile-validator

Conversation

@mnahkies

@mnahkies mnahkies commented Apr 6, 2024

Copy link
Copy Markdown
Owner

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.

mnahkies added 4 commits April 6, 2024 11:36
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 mnahkies changed the title feat: us pre-compiled ajv validators at runtime feat: use pre-compiled ajv validators at runtime Apr 6, 2024
@mnahkies
mnahkies enabled auto-merge (squash) April 6, 2024 11:06
@mnahkies
mnahkies merged commit 5439e9d into main Apr 6, 2024
@mnahkies
mnahkies deleted the mn/feat/pre-compile-validator branch April 6, 2024 11:06
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