From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#27560: 26.0.50; seq-uniq is slow Date: Mon, 03 Jul 2017 22:16:53 +0900 Message-ID: <87inj964oq.fsf@calancha-pc> References: <8760farkxt.fsf@petton.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499087897 11103 195.159.176.226 (3 Jul 2017 13:18:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2017 13:18:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 27560@debbugs.gnu.org, ohwoeowho@gmail.com, tino.calancha@gmail.com To: Nicolas Petton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 03 15:18: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 1dS1Ey-0002ah-LA for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 15:18:12 +0200 Original-Received: from localhost ([::1]:35199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS1F2-0006tO-Ka for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 09:18:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS1Eu-0006rk-Ca for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 09:18:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS1Eo-0003nE-I9 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 09:18:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS1Eo-0003mx-BM for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 09:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dS1Eo-0002Sd-5U for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 09:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jul 2017 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27560 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27560-submit@debbugs.gnu.org id=B27560.14990878329395 (code B ref 27560); Mon, 03 Jul 2017 13:18:02 +0000 Original-Received: (at 27560) by debbugs.gnu.org; 3 Jul 2017 13:17:12 +0000 Original-Received: from localhost ([127.0.0.1]:49528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS1Dz-0002RS-PZ for submit@debbugs.gnu.org; Mon, 03 Jul 2017 09:17:11 -0400 Original-Received: from mail-pg0-f66.google.com ([74.125.83.66]:32854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS1Dy-0002RF-Im for 27560@debbugs.gnu.org; Mon, 03 Jul 2017 09:17:11 -0400 Original-Received: by mail-pg0-f66.google.com with SMTP id u62so23180016pgb.0 for <27560@debbugs.gnu.org>; Mon, 03 Jul 2017 06:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=IKpG8SKOK0eIP1XqufTlOM5e0H27mR5a1u1nNCRp2eA=; b=Zn6Nd2QuDzMMPozlfer27vjfoo+ZNhLoNfLneZjCRrWe03u7OkL4R7Iv3CzX6/UMX3 zlhBlnV1tX7n0sBQc69H/FMU2OZYOEHmjMIUm04ZfFqhas1Dub3Jy887RAPX5RcsC0nl Kfm5zU9rYBrDtZxgDxTbFcqyr4PxS+DvxNt3BDLAAy8ZLNothVLUIzAJBtt98A9NJjyz Da1RtLDE0DbiUhgRI7dqnH8XiighWaqOdVPuIoJaLUyepaCTZRIpyhkfmLLaiOrAN/uC iDWFPfo1LxN3XZ7IREM68fDqP+mFlYuQ6Qn3o/i31DIalDFJTHoCFvcX+9MydS38/Wx2 4nOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=IKpG8SKOK0eIP1XqufTlOM5e0H27mR5a1u1nNCRp2eA=; b=mHeQATwBMD2w6RlxO7VxetNLGrCS+ZLMi5QZsbR43L8n7iertd26gxSbq10PcdtAko nUUTSBZkXcUiBHNc7683adKTEZiDOHZxgszwOLav6cyQcAmeG5zhNSnrLcw77NI43Tgz mb3YXbLqYfgMOtzGGTrEgDoDjtC2C2wiGs/x+o58ceUhEYPqvU9hStGJxUK+Sbc9NAWJ WiRGspb/VZK0AjNQmqgAQuxte91qhrNi5Zq3KE0IxTWPrPSt5cEJz0qYuthPnh2NeHMQ 8x7vEmshGcp+qT5JReD4vGkVCWMnv6o35h8pb692RM2V3DUUfusrFVFh81EadOzGgVfm bTUw== X-Gm-Message-State: AIVw112vlX6J0XltK191/cQXb1SzZKWHM3v2ImeHFGkEOGIw9TtuWJCn Nfnk9nHVoAAlxA== X-Received: by 10.98.153.24 with SMTP id d24mr10116195pfe.223.1499087824510; Mon, 03 Jul 2017 06:17:04 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id u62sm4865304pfa.18.2017.07.03.06.17.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 06:17:04 -0700 (PDT) In-Reply-To: <8760farkxt.fsf@petton.fr> (Nicolas Petton's message of "Mon, 03 Jul 2017 10:20:14 +0200") 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:134117 Archived-At: Nicolas Petton writes: > 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). The numbers above are Oleh's numbers from 2015. If i run similar benchmarks now i don't get such impressive difference between cl-lib/seq: (setq cands (locate-file-completion-table load-path (get-load-suffixes) "" nil t)) ("cc-compat" "vi" "longlines" "rcompile" "eudcb-ph" "yow" "fast-lock" "cl-compat" "mouse-sel" "tpu-mapper" "otodo-mode" "levents" ...) (length cands) 5317 (length (cl-remove-duplicates cands :test 'equal)) 1716 ;; Each benchmark run 5 times: (benchmark-run 1 (helm-fast-remove-dups cands :test 'equal)) (0.003539776 0 0.0) (0.007002079 0 0.0) (0.006296864 0 0.0) (0.002854921 0 0.0) (0.009388854 0 0.0) (benchmark-run 1 (cl-remove-duplicates cands :test 'equal)) (0.558590947 0 0.0) (0.554376583 0 0.0) (0.554984501 0 0.0) (0.583015589 0 0.0) (0.565781774 0 0.0) (benchmark-run 1 (seq-uniq cands 'equal)) (0.36366049 0 0.0) (0.37484882 0 0.0) (0.604267587 1 0.22640233999999282) (0.360611939 0 0.0) (0.392288023 0 0.0) Tino