mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
This commit should reduce the amount of iterations in concatenate to N where N is the sum of the lengths of the input lists. The previous implementation iterated from the beginning in each concatenation because of `last-pair`. This implementation is significantly faster in this extreme case: (concatenate! `(,(iota 50000) ,@(map list (iota 500)))) >> Previous implementation: real 0m0.671s user 0m0.658s sys 0m0.013s >> This implementation: real 0m0.175s user 0m0.174s sys 0m0.001s The tests is done using `time`, which is not reliable at all, but using `(trace last-pair)` shows accurately what happens with the iterations. |
||
---|---|---|
.. | ||
alists.scm | ||
constructors.scm | ||
deletion.scm | ||
fold.scm | ||
immutable.sld | ||
lset.scm | ||
misc.scm | ||
predicates.scm | ||
search.scm | ||
selectors.scm | ||
test.sld |