-
Notifications
You must be signed in to change notification settings - Fork 37
added performance boost to convert case #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
danivek
reviewed
Aug 20, 2019
Contributor
Author
|
Added LRU cache, here are the new benchmarks |
danivek
reviewed
Aug 22, 2019
Owner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I think it's the best way to avoid memory leaks. Good job 👍
Contributor
Author
|
@danivek Do you need anything else from me? |
alechirsch
added a commit
to alechirsch/json-api-serializer
that referenced
this pull request
Dec 10, 2019
added performance boost to convert case with LRU caching mechanism resolves danivek#84
alechirsch
added a commit
to alechirsch/json-api-serializer
that referenced
this pull request
Dec 10, 2019
This reverts commit be79f9e.
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.
I ran the benchmark before and after the changes. It seems to have made deserialization MUCH faster, and a smaller performance boost to serialize.
Resolves #84
Before convertCase optimization
Platform info:
Darwin 18.6.0 x64
Node.JS: 10.15.1
V8: 6.8.275.32-node.12
Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz × 4
Suite:
serializeAsync x 71,616 ops/sec ±1.76% (75 runs sampled)
serialize x 110,926 ops/sec ±4.38% (81 runs sampled)
serializeConvertCase x 70,255 ops/sec ±2.48% (91 runs sampled)
deserializeAsync x 152,227 ops/sec ±2.29% (80 runs sampled)
deserialize x 394,181 ops/sec ±1.24% (91 runs sampled)
deserializeConvertCase x 30,294 ops/sec ±1.01% (92 runs sampled)
serializeError x 284,856 ops/sec ±1.06% (92 runs sampled)
serializeError with a JSON API error object x 12,753,945 ops/sec ±4.90% (91 runs sampled)
After convertCase optimization
Platform info:
Darwin 18.6.0 x64
Node.JS: 10.15.1
V8: 6.8.275.32-node.12
Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz × 4
Suite:
serializeAsync x 70,198 ops/sec ±3.08% (76 runs sampled)
serialize x 119,645 ops/sec ±3.64% (85 runs sampled)
serializeConvertCase x 91,489 ops/sec ±3.21% (88 runs sampled)
deserializeAsync x 144,878 ops/sec ±5.55% (70 runs sampled)
deserialize x 361,896 ops/sec ±3.33% (87 runs sampled)
deserializeConvertCase x 133,200 ops/sec ±1.91% (91 runs sampled)
serializeError x 281,794 ops/sec ±1.05% (84 runs sampled)
serializeError with a JSON API error object x 12,884,729 ops/sec ±1.89% (86 runs sampled)