From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: refile too slow Date: Thu, 5 Oct 2017 15:30:22 -0700 Message-ID: References: <87fuaxk63j.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0Eex-0003wP-Dd for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 18:30:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0Eew-0003pf-3R for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 18:30:27 -0400 Received: from mail-it0-x22a.google.com ([2607:f8b0:4001:c0b::22a]:46029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0Eev-0003ox-Qr for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 18:30:25 -0400 Received: by mail-it0-x22a.google.com with SMTP id x15so3290019itb.0 for ; Thu, 05 Oct 2017 15:30:25 -0700 (PDT) In-Reply-To: <87fuaxk63j.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On 10/5/17, Nicolas Goaziou wrote: >> i think delete-dups is suspicious here. is its only purpose to > > Why is delete-dups suspicious? Have you got a very large number of > refile locations? If so, would it make sense to refine your target > definitions? already do that. my fallback "get most things down to a reasonable level" refile and refile goto were ok until recently. then they became untenably slow. i can't refine it more without missing stuff that i need. > Its purpose, as its name suggests, is to remove duplicate refile > locations you could get. so only useful if i set the variable with duplicate stuff? === delete-dups seems suspicious but what do i know. i wonder if cl-delete-duplicates is more efficient. (defun delete-dups (list) "Destructively remove `equal' duplicates from LIST. Store the result in LIST and return it. LIST must be a proper list. Of several `equal' occurrences of an element in LIST, the first one is kept." (let ((tail list)) (while tail (setcdr tail (delete (car tail) (cdr tail))) (setq tail (cdr tail)))) list)