From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.bugs Subject: bug#27560: 26.0.50; seq-uniq is slow Date: Mon, 03 Jul 2017 10:20:14 +0200 Message-ID: <8760farkxt.fsf@petton.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1499070079 10233 195.159.176.226 (3 Jul 2017 08:21:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2017 08:21:19 +0000 (UTC) Cc: ohwoeowho@gmail.com To: 27560@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 03 10:21:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRwbY-0002HF-HQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 10:21:12 +0200 Original-Received: from localhost ([::1]:33294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRwbd-0004OP-R7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 04:21:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRwbT-0004OF-82 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:21:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRwbO-0006k1-A1 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:21:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRwbO-0006ih-5B for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dRwbN-0000ba-TD for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Petton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jul 2017 08:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27560 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14990700512287 (code B ref -1); Mon, 03 Jul 2017 08:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jul 2017 08:20:51 +0000 Original-Received: from localhost ([127.0.0.1]:49431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRwbD-0000ap-GV for submit@debbugs.gnu.org; Mon, 03 Jul 2017 04:20:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRwbB-0000aN-Po for submit@debbugs.gnu.org; Mon, 03 Jul 2017 04:20:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRwar-0006GJ-At for submit@debbugs.gnu.org; Mon, 03 Jul 2017 04:20:30 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dRwar-0006G5-6z for submit@debbugs.gnu.org; Mon, 03 Jul 2017 04:20:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRwan-0004Lq-5Y for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:20:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRwai-00065j-A8 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:20:25 -0400 Original-Received: from petton.fr ([89.234.186.68]:54916) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dRwah-00060l-SE for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 04:20:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=petton.fr; s=mail; t=1499070015; bh=tZzPvrmI/zJRDYCmm6qnkHWCU7SG032xU/SqupPNtvQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=tU5UKZ6KcqYsqA7O6Ieqdr1g71AoT8fWqIkFbLyBpoufmbqB7pLpabvfFQLRSroj5FBdOmYtuxC0qad+4kjtkCbN0a3vBXMPyaOAVEuEHprwaKuHLTZhjyoO6lD9YLtYq/BeXYxzxRrPRzBkFbBiiR85iEmuFNETpYvUNMA+NjY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134113 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJZWf4+AAoJECM1h6R8IHkQRPUH/RAD+31O6t4JU9++RFNCpbAN mgD0jQeYvKKczRzLJsO6XjqreYzewMfIJUHHxM7QeA2/4/sKUqibSEDIW2XHR/0Q BZmiTQnjhFulpH2fj4ajc+zjae3N4+SwRnLCjAdv1xAWFv3c5rsh1BcS2yyFHXx+ seBjcMngshQYyuUb4BmQvXg12vE+4wbCJygET4PYXrxY8oSFdhf/fElQb/U3CGUa 3cex8QL2mplIZtZ6unUyD87kmW5jkiiXfMOOFSNlJewPkFui+zOVDzwvRGMIApJD qyELoSbM1h8iriI/ZWcvc24Reu32BGkKY1L3HVuSlaEJmF5jYr2hQSLruDLRgKs= =sq8j -----END PGP SIGNATURE----- --==-=-=-- --=-=-=--