From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qJ9lJegKIGO3UgAAbAwnHQ (envelope-from ) for ; Tue, 13 Sep 2022 06:45:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0BqHJOgKIGObLAEAG6o9tA (envelope-from ) for ; Tue, 13 Sep 2022 06:45:28 +0200 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 20E28CCF8 for ; Tue, 13 Sep 2022 06:45:28 +0200 (CEST) Received: from localhost ([::1]:43134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXxnb-0002h0-AP for larch@yhetil.org; Tue, 13 Sep 2022 00:45:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXxmy-0002go-7a for emacs-orgmode@gnu.org; Tue, 13 Sep 2022 00:44:49 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:46910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXxmw-0001mU-Es for emacs-orgmode@gnu.org; Tue, 13 Sep 2022 00:44:47 -0400 Received: by mail-pl1-x62a.google.com with SMTP id jm11so10583196plb.13 for ; Mon, 12 Sep 2022 21:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=QqFWdkrsdC/aJOqQpxbB0MXnP/Dn5WG2jMfoDsgY3WA=; b=PQUFnSdPL7teIyVsqKd3chWgLgXfnlWlXgP/1QNvI6IThxCeuUMGnaJfR5foOgsW2a +oXPPLlFk0t3eHZVg6Ys8othW9tAcU37KcJL6OUG2BkmdNW6KwApZ2wCIfffB7JFW7RF dP1tvrjJhadGVlDogSZ+7mU1+dVJ5FxO3Kr6oEidDSswGRqxmJuS3yYjgrvomAaHSBdd JuRygGrK4BuxzRoGQzyTojFWLZLnPXRbZHNS5DHaVpAbcAH6YwbyjDbHgIdCfhXXTke1 tMiTImrCbEexoyFnhWrhVCknxf2HYCasnU15VBXCbPouVCERlkRJdOT1b9DIvW8c3nnd iObQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=QqFWdkrsdC/aJOqQpxbB0MXnP/Dn5WG2jMfoDsgY3WA=; b=tLu1aCOzuTJBh/jDYLinx5lCtDGmrkqL4I42BC55Pq6lR34E99MbKBs+cJHW0pQT44 mB29aYCdjn/W11QrDKPGHFgM20NN8PVqjFnDQPIHKxON6Bt9AhnGgPpHfP8eqI2kxHIO 5CAcsUAVcYGloQM0AQ1OsMNzF9fsRgyoBD2LZ1z+IPwZiLeTyRwL1DIBsVnTbIw0YboM RNjoZ0dVRShVNw0jv+UM3O8lIX2EkSOfMQ6QsV8Wy+HByPOVS/ceGlwuEt/4xzfDFZrL BjEqEJ52R5cr80IFaZRiQ+pFDkZXPSLDFSDlTBoF3E6AlrTHB5X24DeaSA1iUrUzB8oy 4ssw== X-Gm-Message-State: ACgBeo3tktoma/uedR74maFaK5gdkbxcnlmxtG5zZ++SwdYpx99uyk+j QM1vVhAQFsXFdI+XGzCHUyc= X-Google-Smtp-Source: AA6agR7XRhS/PMU1zVok6PAKA1g+wm6LhcL2pCN4Vc4ZP+1npI58zolfHfusIdpB/0HHcWkGjkjFvg== X-Received: by 2002:a17:90b:4b11:b0:202:998b:71b1 with SMTP id lx17-20020a17090b4b1100b00202998b71b1mr2034500pjb.208.1663044284938; Mon, 12 Sep 2022 21:44:44 -0700 (PDT) Received: from localhost ([2409:8970:a81:48f7:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id i12-20020a170902c94c00b00176da1aae5asm7145254pla.70.2022.09.12.21.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 21:44:44 -0700 (PDT) From: Ihor Radchenko To: =?utf-8?Q?andr=C3=A9s_ram=C3=ADrez?= Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-agenda-list takes 4m compared to 27 that took 15 seconds [9.5.2 (release_9.5.2-25-gaf6f12 @ /usr/share/emacs/28.1/lisp/org/)] In-Reply-To: References: <87wnaeo18w.fsf@localhost> <8735cwujed.fsf@localhost> <87k068t1qf.fsf@localhost> Date: Tue, 13 Sep 2022 12:45:36 +0800 Message-ID: <87h71bdgr3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663044328; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=QqFWdkrsdC/aJOqQpxbB0MXnP/Dn5WG2jMfoDsgY3WA=; b=RK/M+3DGKo0nYbq8Pzx5xKOl/IkB1Z9iHC4gKeEEe55sOUfMCn/BQl8k6xjhyW4IsMxYzF BPMXaxIwCOj7SZ68hVoZEUMfd89jcI1AmGgaMBNMpQNm6xF1x0jp27dpC1RTwamJYTzzbS vJaLjt5cLLG7UFzuf36otLGsUGTVSnWOkDsUasaDmHdMkJk64saflvw12Xk1Q2aotYnFmw jvLeD+74BMc349ZhJQDVh0Wdc6CMrD1B+8dMRkgSNgXoyZ5FITfCOZ0ab1ftOZolpJCzU8 bvBN5KImb80ztlOfgoRVJjXk8/6SzJ/kQ8Rfjfbon0seghKvU2QC5vnm71HRJw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663044328; a=rsa-sha256; cv=none; b=AlI6F8m96pIoZOg5B6xXm3g0Cx3ISxCv61NrcA9NZ2M1Sidj2YGgvr2A2FIs5LrwyXCvl5 +K5tLHgNAXTM4C75X+wyl9gjoevagXXHnNF0drxbwt1wsyq02PZh31XNNt95FC3naoFHHT udrqCEfKDF8uQk/jQCEp6lmFw/2LAopNiJ7oNd1ScW1o3zLoeXdxA0GBeeWGi3ZUIlqkiN Dw2t8V+KaucObsnLgFd7Yql2RYiDnubCjbGhirfqkM5sIeBM0BhNk7g6mx910Oa6ohwuUT ARqulBr1yZOdUhETdOhPNWOiBNouuqmw50W8IXDUAeizu5O+oQGIBYEHeJPO0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PQUFnSdP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.81 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PQUFnSdP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 20E28CCF8 X-Spam-Score: -1.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: ztp6T/rN5Q8C andr=C3=A9s ram=C3=ADrez writes: > Hi. Ihor. > >>>>>> "Ihor" =3D=3D Ihor Radchenko writes: > > [...] > > Ihor> Can you then execute (setq org-element--cache-self-verify nil) > Ihor> and repeat the steps? > > Done. > > The produced file. Thanks! Now, can you execute the following and let me know if the performance is back to satisfactory? (setq org-element--cache-self-verify nil) (defun org-back-to-heading (&optional invisible-ok) "Go back to beginning of heading." (beginning-of-line) (or (org-at-heading-p (not invisible-ok)) (if (org-element--cache-active-p) (let ((heading (org-element-lineage (org-element-at-point) '(headline inlinetask) 'include-self))) (when heading (goto-char (org-element-property :begin heading))) (while (and (not invisible-ok) heading (org-fold-folded-p)) (goto-char (org-fold-core-previous-visibility-change)) (setq heading (org-element-lineage (org-element-at-point) '(headline inlinetask) 'include-self)) (when heading (goto-char (org-element-property :begin heading)))) (unless heading (user-error "Before first headline at position %d in buffer %= s" (point) (current-buffer))) (point)) (let (found) (save-excursion ;; At inlinetask end. Move to bol, so that the following ;; search goes to the beginning of the inlinetask. (when (and (featurep 'org-inlinetask) (fboundp 'org-inlinetask-end-p) (org-inlinetask-end-p)) (goto-char (line-beginning-position))) (while (not found) (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)") nil t) (user-error "Before first headline at position %d in buff= er %s" (point) (current-buffer))) ;; Skip inlinetask end. (if (and (featurep 'org-inlinetask) (fboundp 'org-inlinetask-end-p) (org-inlinetask-end-p)) (org-inlinetask-goto-beginning) (setq found (and (or invisible-ok (not (org-fold-folded-p))) (point)))))) (goto-char found) found)))) --=20 Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92