From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gMNXFO0jaGf5JgEAqHPOHw:P1 (envelope-from ) for ; Sun, 22 Dec 2024 14:36:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gMNXFO0jaGf5JgEAqHPOHw (envelope-from ) for ; Sun, 22 Dec 2024 15:36:29 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="byRivb8/"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734878188; 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=lh2F19QTOv7vnD9Oh/yVFn1SKDg23owa//loPmVOXAM=; b=N4Odm9aGvTaHzqsUFMGHS5Fx+OHwOp34jJS1Fc52xJCpx1uTdkaKAUM3mK2j+qbffGLm9E PjDkILtW/8m/rSD9vYHrah0qaSTQEQjL+GpOTmDc6Zbcqdfi/k/Oz9EhSYoQPtFKhdaPPC Yvapx/98/Tnc1csHtBQHEgeJ9QbgmgCFJ99rV9ouQKy4W1FdhhM06nzJa9vL59xp6Ag+O9 Ee2KfiO7N4z/Dx3rlAsmKKOwxlpUG9KKc5z+4KPD7IGEvdX4yU6IzrvYrvohk0zJDj9zyY CRgoNr9D5dtr66UCXIndluf2E+j4H8d+Q4xvFI0s6B8cb9m3by2AN9PrIMmhEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="byRivb8/"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734878188; a=rsa-sha256; cv=none; b=Nvf/Z1yNttCoAcKvPKaPTIDeeZf5cZMRh/5uhFKTZ0bGyK/fgeP0QSNFeWbzEz8S2P0XCV 8J6nDcbgSu8XqftF4TpGOgp2GCChKRB+Eo5p6JcMPo9swau3lzhAxcazoMBMqZN+LfC6HX 4haQY76Wh1GRQNLAWxYi0Pvg7OnK67GqiCrfvwZxZAy8/LaLKkmAtg28/DzZMO62/+T44A ctTyDGgfIsMCv+7TG/djsJFzWNnbR6V38Mjb/FvGzT/de0sRCfOCljZ+Lp5npHXH+3BknK rBip0B6LVO4FLKkkc9cMiPv9HaHnWPr7yHfuph8Ygx79+YTLrmtRM3jyrl2QFA== 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 2D76924A61 for ; Sun, 22 Dec 2024 15:36:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPN3S-00005D-Vv; Sun, 22 Dec 2024 09:35:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPN3Q-000053-AW for emacs-orgmode@gnu.org; Sun, 22 Dec 2024 09:35:36 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPN3O-0007BB-69 for emacs-orgmode@gnu.org; Sun, 22 Dec 2024 09:35:36 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AE18C240101 for ; Sun, 22 Dec 2024 15:35:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734878131; bh=vDIGQkFn+Qtq1KjmtXLECcelnITOp9SoCaQ3uRJKp5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=byRivb8/4PCj+e1YrRwIzCEKHxXZmQ5KvZnSjsyiWrRlrQofioXFowEyfcKpkqO03 sWHoAXchwuiCt1PINpqLKgZnrZM7mBtVliQo8G1j+aJpjm+rZaTHDAjXS4XEJj2Fy/ r1O/ybVmZdxOujaS3odYLVCS1DIgRtjbcye4CLim0qmS52g/qPOz9uq74xvHsVTPL5 dAPRBSrTc/IlMqrm0NkJZUXu16eJykxOScS+K8I5HqTdjVEDIrXCoGFcaQTF3Kt/ln Dl4zuQJfPdUuDAhwYWTfgwYtr+afOTbHsxlECovBfYXOdpoxxoq4nIKQJ88d9AXk6Y sAwE/pdocaFxQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YGNwy42Y1z6twH; Sun, 22 Dec 2024 15:35:30 +0100 (CET) From: Ihor Radchenko To: Michael Brand Cc: Org Mode Subject: Re: Performance of property drawers in Org cache In-Reply-To: References: Date: Sun, 22 Dec 2024 14:37:02 +0000 Message-ID: <87zfkn7pip.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.99 X-Spam-Score: -5.99 X-Migadu-Queue-Id: 2D76924A61 X-TUID: 7HoAB+ab7WAZ Michael Brand writes: > Now I would like to report issues with the performance of property > drawers in Org cache. The time it takes to open an Org file with a > useful amount of property drawers like in test_1.org has increased too > much for me to update from Org mode 9.5, see the table below. This is because of new `org-cycle-hide-drawer-startup' that is set to t by default. Previously, drawers were not folded on startup. Instead, they were folded every time you unfold a heading, via `org-cycle-hook' (it no longer contains `org-cycle-hide-drawers' entry by default). This change was a tradeoff. Folding many drawers can be expensive, and we increased the time for opening an Org buffer in exchange for faster folding later. > Org loading performance has also degraded a bit but I assume and hope > that the amount is not more than necessary for the convenience of > having more Org features preloaded. This is hard to control, unfortunately. Org libraries are so much entangled together that almost everything has to be loaded every time you load Org. I hope to address this, but it is not a trivial task. > To do some homework I looked in Org news, the mailing list, the > Commentary of org-element-ast.el and an overview of > org-element-ast.el. The beginning of the result of > ~(org-element-cache-map #'car :granularity 'element)~ (as found in > test-org-element.el) and its length of 3003 for test_1.org look > completely reasonable to me. ~org-element--cache-map-statistic t~ does > not reveal where the by far large rest of the total time goes: "Total > time: 10.668449 sec. Pre-process time: 0.000000 sec. Predicate time: > 0.014772 sec. Re-search time: 0.000000 sec.". I am surprised that a > repeated use of ~org-element-cache-map~ is still quite slow: 2.0 s > without statistic for iterating over 3003 cached AST nodes to collect > their ~car~?. Obviously I am a bit overchallenged with the Org cache > and hope that someone can look into this. This is what I am getting on your test_1.org: Mapped over elements in #. 3006/3006 predicate matches. Total time: 0.275971 sec. Pre-process time: 0.000000 sec. Predicate time: 0.002361 sec. Re-search time: 0.000000 sec. In this case, it is very important that Org mode should be compiled. > Out of curiosity: What consumes time during killing an Org buffer that > seems to scale with the buffer/cache size? What has to be done more > than just garbage collection that can be deferred to after killing has > finished? org-element-cache-persistent: writing parser cache to disk. May it be deferred? It might, I think. But Emacs will be blocked at some point anyway while doing so. You can disable writing cache, if it is what you prefer. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at