-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Chore/optimize #10091
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
Chore/optimize #10091
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10091 +/- ##
==========================================
- Coverage 96.37% 96.3% -0.07%
==========================================
Files 63 63
Lines 9411 9424 +13
==========================================
+ Hits 9070 9076 +6
- Misses 341 348 +7
Continue to review full report at Codecov.
|
6b0f6f0 to
72ecb9d
Compare
29531a3 to
b5fee4f
Compare
|
Addressed all comments and squashed all commits since there isn't much point in keeping them separate anymore, waiting for CI build to pass now. |
|
@sushantdhiman we good now? |
b5fee4f to
9d48cf0
Compare
|
done |
|
Thanks @SimonSchick |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
This PR does a couple of things (please advise if I should split this into separate PRs) that are all somewhat related.
Replace various operations with faster equivalents (contains some minor
else ifsimplification as well.Main component is the replacement of
_.memoizewhich was used to cache array lookups with shinySets. This also removes some dead code.While debugging and issue I got really frustrated with the amount of conditional nesting is going on
I reduced the amount of
return } else if (...)by roughly 50% (mostly using return instead).In
query.jsI also wrapped some promises that were doubled wrapped and nested for some reason, this code is drastically simpler nowThis broke stuff, I still moved the post query logic to a method to make it easier to read.NOTE: I switched the test reporter to
dotas that is slightly faster and doesn't create so much useless output, please mention if this is undesirable.Replaces all occurences of
new Bufferandsinon.sandbox.createand stubbed out (most) data-type related warnings that were spamming logs.Also refactoredNvm see nodejs/node#23960ABSTRACTprototype class to class since it's never directly instantiated.Previously forgot to port this :)