From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id j2TKCV7mQGBqZAAA0tVLHw (envelope-from ) for ; Thu, 04 Mar 2021 13:53:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sDX3BF7mQGC2EAAAbx9fmQ (envelope-from ) for ; Thu, 04 Mar 2021 13:53:34 +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 608FA23322 for ; Thu, 4 Mar 2021 14:53:33 +0100 (CET) Received: from localhost ([::1]:39294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHoQ0-0000GO-Df for larch@yhetil.org; Thu, 04 Mar 2021 08:53:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHoOJ-0007lh-Vy for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 08:51:48 -0500 Received: from ciao.gmane.io ([116.202.254.214]:57924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHoOI-0006s8-1o for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 08:51:47 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lHoOF-000A48-Tj for emacs-orgmode@gnu.org; Thu, 04 Mar 2021 14:51:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: org-refile-use-cache and jumps using org-refile or org-goto Date: Thu, 4 Mar 2021 20:51:37 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , 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=1614866013; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MwiP2znxvV3c4De6hQJ8H8QaESRGUFoHD4qxA9xSAq0=; b=aPd+fBi22XXUCTw13V0MruRG9rmMRBTJLhUZbZ1JPYmpmkJq0cWC9JqHSEJVJBfU7deiky 3gvNKnaos53T00KbFcuQu6r5tKZanMVq3tJ90/0yIQaIWtu/OL8OHk1B3m8AdjAN0qRa13 9y+tr7dx9DY4vZY2rL6ZgTKXBAIfGYdaUwZkXsgO7QQuk3TtyiFFyN1AXlNbFXmJ7Wmkmm YPqQgrQBWUfmZYLTfMiAsTXV58sNRm4WckzbteaYDmyCGxwSFilAL2jMnoy1tDp/OoDshv WGHRkZrGZ7LoK5cpl07A7lvEgMHN3i/Xo4kaTdw/jy49dxwhpfO4wdiKv2AGOw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614866013; a=rsa-sha256; cv=none; b=gJvdDr8EMGbX1eP8BQA5ji1yEWsub5ZbDgo4FVMNt17DH9YXg/a6uUh5xxOtNLx/62GTpk f1PeSihH9RhJg02Obbnh9wdrbAERGUTaDK0tIza3xQSJddfrXyAz3eiXeed9u46mVbYnIU EDpgciPM7m1rH1Vv8xHGVjt3DUHYwcTSs6p5aX88trsK0TN9PuPAUYEQPhbSfDbTooLG1P wHrTkJXWBWoSuQdmwwyi5hYm6V3UijnEhU+N8IuwRNZHCpsPmZ6I6SS+4PWyt1alp9w3St Stpjj+o/wjubMDtTrrdjiBfy3RQQB8fnjPOUb5E7TTNer+DQcbNSP3KGdPPcWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: -1.76 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 608FA23322 X-Spam-Score: -1.76 X-Migadu-Scanner: scn1.migadu.com X-TUID: UicLJfsth9lg 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.