From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id jpssNGpLQWBCOQAA0tVLHw (envelope-from ) for ; Thu, 04 Mar 2021 21:04:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8EGKL2pLQWDFDAAAB5/wlQ (envelope-from ) for ; Thu, 04 Mar 2021 21:04:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 21C2522EEE for ; Thu, 4 Mar 2021 22:04:42 +0100 (CET) Received: from localhost ([::1]:59888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHv9F-0003j0-2e for larch@yhetil.org; Thu, 04 Mar 2021 16:04:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHv8d-0003ie-Te for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 16:04:03 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:34690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHv8b-0000UP-Us for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 16:04:03 -0500 Received: by mail-lf1-x131.google.com with SMTP id v9so160962lfa.1 for ; Thu, 04 Mar 2021 13:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IchPmbx+ZV3PkmtdjFh7oM6hy0acAZDVIg+MrJVu6Hg=; b=D7KqUyfx5XqfTeDm+Or+fEF+Cd3CbHinIomb3g56Zh8hI3XbbHUyIg5YDpAWFL9Lfy ZBWBwdpE/Gl4/mhaUQJqXlUg2ejyh4Wq++BrgHahI6mO4MSuIye0+rrXxMHwOasgabuE nypY7DnFXAA2/9hEl0p8TnZWzTQaUbkILgjKykNIKqVvbvNJ+aS7jhEnGm70xrD/DuRM 8HFSjA1yjPgHUxFMXvFGRwIG6zr5Ur2wGylR2WUxE/QIirOnnXXdB999/M9xYTtAvtbx 7NJjoZr+cGL8AYZFncl5lVbxcDLxPAe9dWClyK3dsBzgl6WyEN/lkFD62BVjBAPOf9FK SPtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IchPmbx+ZV3PkmtdjFh7oM6hy0acAZDVIg+MrJVu6Hg=; b=HDCozxFaRFx5InqrKOZ3Uysh5ROn6LvbkdCvQ2bshzAs/vYotfEvF/np4FMVh2rIhR D0bzzJVSgay/gFL5cA9aCDxoqiTPjEow3DjebmdPkFehmYQZ899SG3WHAANV8f31cO68 JyeHAuPbv0UC0nYjsO/NO18zVchFWx4tAlLhjgEmB5anwcsyJSoCKAEDcSWIiPbOB1Je phT0i+o7x6lURAbliXDglmTNjz4P+LVcIj7CLvu5BEDazFqueqKU20U2YOvtL1U607fH OEfE90KL922uv47By360wxljtcJ1NJxzhGho/jgYpdFymxrT41iVvj16kkSwywHw8s+k kuNg== X-Gm-Message-State: AOAM533XXePS3MwM4I3hvAJghnjfeSBh+Beg7sFOs+P6lRDNN5rR4A+M irJaDuQcfZ9W5V2cercTOzqZiq7EhGon2246quI= X-Google-Smtp-Source: ABdhPJwzc6sPuVn71V8s98JEwH5HmImAmrwVt9ZkbEegB2Iy3LsGd2W4hL3b+dzrAuvCtIwWuiAXYZjajdUBU8Omig0= X-Received: by 2002:ac2:4306:: with SMTP id l6mr3489111lfh.441.1614891839092; Thu, 04 Mar 2021 13:03:59 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab3:7842:0:0:0:0:0 with HTTP; Thu, 4 Mar 2021 13:03:58 -0800 (PST) In-Reply-To: References: From: Samuel Wales Date: Thu, 4 Mar 2021 14:03:58 -0700 Message-ID: Subject: Re: org-refile-use-cache and jumps using org-refile or org-goto To: Maxim Nikulin Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=samologist@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614891882; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=IchPmbx+ZV3PkmtdjFh7oM6hy0acAZDVIg+MrJVu6Hg=; b=tSRJyXmy8PU8+k2obRVn1CDcDcIpTfMHQoeA1x6m61/3StIMXGqbZx5ikxCfmaOwyp8Lde lMA/BW+aD8zP2hEuJKne5f8BjARXzSP2onYSNbYTYs2eyybgWC6k0Cnno+oII/4IDJOnP5 TT+J/DB7b62VKt5FaWUawF/zdIE7wGll2upuwS2QqfpNwnDiFjjMVdIA5MnvZulAcLoinm 2HWx/1Q3X3K4id6JgYo7SZidJT7ho9/7UhbFPfd7gS3IEC9/fE2Bvdm9Q3ckDuKnwbcz5r ekSDO+E/6n941NrLnkFvoUoK50GucQTAioLpUhd2Fii5uZ7JS+N8QHeoW3UXmQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614891882; a=rsa-sha256; cv=none; b=VeEkzdHSVNt3bMBr66QjXwczMNpn7XCbjwhtaLrhWGZoITt2WpsbjdQGUvngeEAeyD8Y4f DCUaK04WndoA52e3zYPeutlkAc7gIOJ0eV/NagHVF7gQnzx01NAJFJDlvNE8lGEaH69b5T /+kv/Cu44Hx2/iIwtSLN2ZDZcqZ7Lyth68cXhINj5gWHgvZ2bOUzXm8dYtIFS2GYLKIOeU e0Rai1CHSPOl1oFSdB8AG/90umTT2uku57akxaNFbDLef8TdWErOAauthADoIaTfEQg5Hn nUq1oL8BeaxjegBRI4bfJzs7EJGcM+wzJ0Yi98AzLGziYxFgt7NV5a8H+P3QLg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=D7KqUyfx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=D7KqUyfx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 21C2522EEE X-Spam-Score: -3.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: Fycj9EAPe6wI interesting. that would be great to speed it up. [i just meant that the file list used to be correct.] but it is slow these days. for me, (benchmark-run 1 (length (org-refile-get-targets))) is 8s for 5886 targets. i presume you mean something like that up heading is unnecessary because you can keep a running olpath as you search. On 3/4/21, Maxim Nikulin wrote: > On 03/03/2021 09:34, Samuel Wales wrote: >> >> until recently in maint, ido and ido hacks with both refile and refile >> goto [note: org-refile with a goto arg, not org-goto] has worked >> perfectly. with no cache. now, there is an issue, where with no >> cache that i know of, the first use, or the first use in a long time, >> will actually present a huge file list that includes crazy elements >> and is not constrained by even the verify function. > > Concerning performance. After reading your message I have realized that > it should be really fast to extract several thousand headings from a > buffer using regexp. However actually it is not so: > > (benchmark-run 10 (and (org-refile-get-targets) nil)) > | 9.868742533999999 | 40 | 2.999932755999996 | > > So preparing the list of refile targets currently takes almost precisely > 1 second. It is slow. Results are same for org-9.1.6 and > release_9.4.4-231-gf46925. I am surprised however that 9.1.6 and 9.3.1 > are installed as system packages and have compiled files. I have not > compiled git version but it works with the same speed. > > (length (org-refile-get-targets)) > : 3220 > > Preferences: > > (require 'org-refile) > (setq org-agenda-files '("~/notes/notes.org")) > (setq org-refile-use-cache nil) > (setq org-refile-use-outline-path t) > (setq org-outline-path-complete-in-steps nil) > (setq org-refile-targets '((org-agenda-files :maxlevel . 5))) > > Some lines from profile: > > - org-refile-get-targets 8414 74% > ... - org-get-outline-path 7403 65% > ... - org--get-outline-path-1 7286 64% > ... - org-up-heading-safe 6328 56% > > There is a room for improvement. Outline paths could be obtained in a > single pass without backward search. It should speed up building the > list of targets by 2 or 3 times. > > Though it is unrelated to issues with default option and cache entries > when both ways to call org-refile are used: directly and through org-goto. > > > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html