chibi-scheme/lib/srfi/1
Ekaitz Zarraga 967b888d8c Reduce iterations in concatenate!
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.
2024-01-09 17:18:41 +01:00
..
alists.scm fixing corner cases in pair-fold, alist-delete and reduce-right 2017-08-24 21:27:08 +09:00
constructors.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
deletion.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
fold.scm fixing corner cases in pair-fold, alist-delete and reduce-right 2017-08-24 21:27:08 +09:00
immutable.sld adding (srfi 116) 2017-08-24 21:29:33 +09:00
lset.scm fix order of arguments in lset= 2020-05-27 14:27:31 +09:00
misc.scm Reduce iterations in concatenate! 2024-01-09 17:18:41 +01:00
predicates.scm add check for empty second list in list= (fixes issue #407) 2017-05-08 12:04:13 +09:00
search.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
selectors.scm Correction to the 8-10th selector aliases 2015-06-06 17:19:45 +02:00
test.sld srfi: 1: add tests for append! (and concatenate!) 2024-01-09 01:04:34 +01:00