-
Notifications
You must be signed in to change notification settings - Fork 2
Optimize tree construction #108
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
Comments
Maybe point 2 should be recurse when |
The first draft implementation is twice slower than repeated This merging approach does not seem to make sense if we want to gain speed because it causes too many structure changes*. A better approach comes to mind: do repeated * while not efficient, this implementation constitues a good benchmark for the underlying operations. |
Plan:
from
,prepend
, andappend
._from_array
similar to_from_small_list
but recurse whenarray.length >= 12
._from_iterable
as an iterative version of_from_array
(see Optimize tree construction #108 (comment)).See if replacing push loop inNO (because we do not want to keep two copies of the data simultaneously)from
by_from_array([...iterable])
is faster (optimize?).this.append(iterable)
asthis.concat(from(..., iterable))
improves performance.prepend
.The text was updated successfully, but these errors were encountered: