GNU bug report logs - #57079
29.0.50; Performance of seq-uniq is not very good

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Tue, 9 Aug 2022 16:12:02 UTC

Severity: minor

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: 57079 <at> debbugs.gnu.org
Subject: bug#57079: 29.0.50; Performance of seq-uniq is not very good
Date: Tue, 9 Aug 2022 09:11:07 -0700
Severity: minor

`seq-uniq' is not very performant compared to `-uniq' (from dash.el) and
even slower compared to the recently removed `gnus-delete-duplicates':

    (benchmark-run 10000 (seq-uniq '(a c b c c a d)))
    => (0.355001481 1 0.2518970439999748)

    (benchmark-run 10000 (-uniq '(a c b c c a d)))
    => (0.006599549 0 0.0)

    (benchmark-run 10000 (gnus-delete-duplicates '(a c b c c a d)))
    => (0.0034537929999999997 0 0.0)

Could we improve the performance of `seq-uniq' for lists?


PS. `gnus-delete-duplicates' was recently removed but looks like this:

    (defun gnus-delete-duplicates (list)
      "Remove duplicate entries from LIST."
      (let ((result nil))
        (while list
          (unless (member (car list) result)
    	(push (car list) result))
          (pop list))
        (nreverse result)))




This bug report was last modified 3 years and 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.