-
Notifications
You must be signed in to change notification settings - Fork 2
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
Make it run faster. #205
Draft
make-github-pseudonymous-again
wants to merge
50
commits into
main
Choose a base branch
from
perf-inline-everything
base: main
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
Make it run faster. #205
Conversation
This file contains 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
a6fcc0a
to
38b9e05
Compare
3d163af
to
7362602
Compare
Codecov Report
@@ Coverage Diff @@
## main #205 +/- ##
==========================================
+ Coverage 98.20% 99.10% +0.90%
==========================================
Files 49 61 +12
Lines 1282 2469 +1187
==========================================
+ Hits 1259 2447 +1188
+ Misses 23 22 -1
Continue to review full report at Codecov.
|
7362602
to
f9aca58
Compare
fa786bd
to
1b0c57c
Compare
1b0c57c
to
b14478c
Compare
This is to workaround conventional-changelog/commitlint#2742.
For comparison.
We immediately instantiate a Digit or null. It's a win-win best deal ever: - If we need a Digit, it's there! - No need to branch on list.length! So we win even when we need a Tree. Also we use separate struct DigitSplit to store result of _splitDigit since member types are not the same as in a tree Split. Maybe should rename Split to TreeSplit later.
This introduces more non-pure methods which can only be used with care. Currently these are prefixed with _UNSAFE_ but maybe _NON_PURE_ would be better? The dev and user experience would certainly be better if we exploited TypeScript types to ensure whatever is passed down to these methods is marked as mutable (including `this`) and whatever comes out of the API is immutable. We could also expose these non-pure methods for special usage but with extreme care. Maybe something like `tree.mutable()._NON_PURE_push(x).immutable();` or `tree.bulk((mutable) => mutable._NON_PURE_push(x));`. There are examples on how to handle this in `funkia/list` and `immutable.js`. Is the _NON_PURE_ prefix really necessary then? The two previous points would allow and exploit the definition of a `VolatileDeep` or `MutableDeep`, not sure on the name yet, whose right and/or left digit is mutable ("or" because we could also settle on `PushableDeep` and `ConsableDeep`). This would allow to replace digits with either specialized mutable digit objects OR with JavaScript Arrays depending on which solution is faster (member assignment + class method table or Array push + switch on Array length).
This also has the benefit of reducing legacy bundle sizes.
b14478c
to
539c048
Compare
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.
The goal is to take care of #120 and #108.