-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Reduce memory allocation in rules and utils #2976
Draft
willheslam
wants to merge
13
commits into
jsx-eslint:master
Choose a base branch
from
willheslam:optimisations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on May 4, 2021
-
Configuration menu - View commit details
-
Copy full SHA for b4cd869 - Browse repository at this point
Copy the full SHA b4cd869View commit details -
Configuration menu - View commit details
-
Copy full SHA for 152a276 - Browse repository at this point
Copy the full SHA 152a276View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35a88cb - Browse repository at this point
Copy the full SHA 35a88cbView commit details -
Speed up string manipulation and testing
- Avoid creating new strings by replacing string splits and trims with RegExps - Avoid dynamically generating RegExps when possible - Compare some arrays by identity first, before checking join('') string identity
Configuration menu - View commit details
-
Copy full SHA for 69bcb8d - Browse repository at this point
Copy the full SHA 69bcb8dView commit details -
Speed up Components list by avoiding some array allocations and remov…
…ing some closures
Configuration menu - View commit details
-
Copy full SHA for da9231a - Browse repository at this point
Copy the full SHA da9231aView commit details -
- Avoid allocations where possible (e.g. concating with an empty list) - Promote some pure functions to module scope - Avoid some wasteful array allocations (filter & length => reduce / some) - Move some calculations behind early returns / guards
Configuration menu - View commit details
-
Copy full SHA for 8eff94d - Browse repository at this point
Copy the full SHA 8eff94dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 671341e - Browse repository at this point
Copy the full SHA 671341eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f7183e - Browse repository at this point
Copy the full SHA 0f7183eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 473d7c1 - Browse repository at this point
Copy the full SHA 473d7c1View commit details -
- Cache deprecated config - Precompute versions instead of re-derive it for each check - Avoid reallocating some functions - Avoid normalizing already normalized parts
Configuration menu - View commit details
-
Copy full SHA for ccdd17c - Browse repository at this point
Copy the full SHA ccdd17cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a2b5327 - Browse repository at this point
Copy the full SHA a2b5327View commit details -
Configuration menu - View commit details
-
Copy full SHA for d16fcb3 - Browse repository at this point
Copy the full SHA d16fcb3View commit details -
Various speed ups by avoiding work and memory allocations
- Combine filter -> forEach chains - Extract deeply nested functions to higher scopes - Promote shared or mostly-constant values and conditionals to higher scopes - Swap compound boolean expressions to exploit short circuiting - Push expensive operations below guards / early returns - Push expensive operations into conditionals to exploit short circuiting - Swap filters for finds when possible - Swap some array function orders, e.g. Filter before reversing arrays
Configuration menu - View commit details
-
Copy full SHA for 232d6a1 - Browse repository at this point
Copy the full SHA 232d6a1View commit details
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.