--- Begin Message ---
Subject: |
26.0.50; seq-uniq is slow |
Date: |
Mon, 03 Jul 2017 10:20:14 +0200 |
Oleh (in Cc) did some benchmarks in May 2015, and `seq-uniq' is quite
slow:
(setq cands (locate-file-completion-table
load-path (get-load-suffixes) "" nil t))
(length cands)
5357
(length (cl-remove-duplicates cands :test 'equal))
2481
(benchmark-run (cl-remove-duplicates cands :test 'equal))
(0.67873101 0 0.0)
(benchmark-run (helm-fast-remove-dups cands :test 'equal))
(0.001350054 0 0.0)
(benchmark-run (seq-uniq cands 'equal))
(5.270219822 27 2.396615401000002)
One easy way to make it faster would be to use `cl-remove-duplicates'
for sequences (sequencep), and default to the current implementation for
other seqp data structures (which means stream.el currently AFAIK).
Nico
signature.asc
Description: PGP signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#27560: 26.0.50; seq-uniq is slow |
Date: |
Mon, 03 Jul 2017 16:09:02 +0200 |
Nicolas Petton <address@hidden> writes:
>> Indeed, I will run some benchmarks as well. In your benchmarks, cl-lib
>> is still much faster than seq-uniq, even if it's not as impressive as
>> Oleh's benchmark.
>
> It looks like I read the benchmark results wrong :)
seq-uniq seems to be much faster than in 2015, while its definition
basically hasn't changed. I won't investigate much further as I'm happy
with then benchmark results.
Nico
signature.asc
Description: PGP signature
--- End Message ---