Memory usage improvements#1292
Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:release-0-9from Dec 10, 2019
Merged
Conversation
Author
|
@lgebhardt Any thoughts about this? Thanks |
lgebhardt
approved these changes
Nov 16, 2019
Contributor
lgebhardt
left a comment
There was a problem hiding this comment.
@krasnoukhov This looks good to me. I don't think the freezing of the DEFAULT_ATTRIBUTE_OPTIONS will cause a problem since default_attribute_options is only being used as the basis for a merge, which returns a new hash. Thanks!
Author
|
@lgebhardt Makes sense, thanks! I created this for 0.9 release branch, do you want to merge and then I'll port to master as well? |
hesalx
reviewed
Nov 22, 2019
| spec.add_development_dependency 'pry' | ||
| spec.add_development_dependency 'concurrent-ruby-ext' | ||
| spec.add_development_dependency 'database_cleaner' | ||
| spec.add_development_dependency 'memory_profiler' |
Contributor
There was a problem hiding this comment.
I don't think this should be included in the gem itself.
Contributor
There was a problem hiding this comment.
@hesalx It seems like keeping the memory_profiler included as a development dependency should be safe and useful. What's your reasoning for not including it?
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.
Run the benchmark with memory report:
MEMORY_PROFILER=1 bundle exec ruby test/benchmark/request_benchmark.rbWhat was improved:
DEFAULT_ATTRIBUTE_OPTIONSis now a frozen constant (might break apps, but easy to fix?)MODULE_PATH_REGEXPis now a frozen constant (but maybe some caching can be used to improve even further)Before: caching ~2.78s (~43mb), uncached ~3.35s (~186mb)
After: caching ~2.59s (~42mb), uncached ~2.66s (~127mb)
All Submissions:
New Feature Submissions:
Bug fixes and Changes to Core Features:
Test Plan:
Reviewer Checklist: