improve performance of safeParse#81
Merged
mcollina merged 4 commits intofastify:masterfrom Jul 29, 2022
Merged
Conversation
Member
|
linting is failing |
mcollina
reviewed
Jul 29, 2022
Member
mcollina
left a comment
There was a problem hiding this comment.
Is this a semver-major change?
Contributor
Author
|
Should not be backwards breaking. I just corrected the typings of scan. |
Member
|
Can you send a PR to fastify to use this instead? It should improve things in case of a failure. |
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.
before:
JSON.parse x 1,711,391 ops/sec ±0.86% (87 runs sampled)
JSON.parse proto x 1,077,100 ops/sec ±1.18% (90 runs sampled)
secure-json-parse parse x 1,430,832 ops/sec ±1.00% (91 runs sampled)
secure-json-parse parse proto x 1,576,912 ops/sec ±1.14% (84 runs sampled)
secure-json-parse safeParse x 1,420,410 ops/sec ±1.06% (87 runs sampled)
secure-json-parse safeParse proto x 139,151 ops/sec ±0.97% (90 runs sampled)
JSON.parse reviver x 497,298 ops/sec ±0.83% (90 runs sampled)
after:
JSON.parse x 1,738,271 ops/sec ±0.84% (88 runs sampled)
JSON.parse proto x 1,100,147 ops/sec ±1.23% (89 runs sampled)
secure-json-parse parse x 1,441,809 ops/sec ±0.79% (91 runs sampled)
secure-json-parse parse proto x 1,592,567 ops/sec ±0.82% (82 runs sampled)
secure-json-parse safeParse x 1,405,980 ops/sec ±1.30% (90 runs sampled)
secure-json-parse safeParse proto x 917,157 ops/sec ±0.81% (92 runs sampled)
JSON.parse reviver x 501,752 ops/sec ±0.78% (88 runs sampled)
Checklist
npm run testandnpm run benchmarkand the Code of conduct