From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mOp3CvUwhGaqogAAqHPOHw:P1 (envelope-from ) for ; Tue, 02 Jul 2024 16:55:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mOp3CvUwhGaqogAAqHPOHw (envelope-from ) for ; Tue, 02 Jul 2024 18:55:17 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fIMdstas; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719939317; 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=VmCIVWqSEaQqVQAYYGl1m2U8qdWzFxa8033e6oYKOQ0=; b=Stgb8JR15CQQVmXg7k4XU3YbOd1owrq6zCjbro5EEbVfM4hWm8Zi0Zh4mzcExDqKb96+sD gjw0Sz9EIdxzaZdRtQQG2b6N67dqEfKXyfu4U/9AXJnRtriA1ixM3F/jWjeFQLkKJyJcE0 owgXaVnAP0UcwmFyCjxBEwSB+CFY1cMXAtLipCb1q3eKFIsl8KNMzLCeofcdwcUfQN29ZU QuF4gDrAVkay5mH+69UOJj3EYuBZyIKhAfi/pQ0InbWHtymyBqc/8E33PFPMIiBmAEz4BU pqsJ0sDIfQV8SbxK/TPcZmAJR8s+ooe/bnel6THJKKJAykTKnJJmLo989hBl5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fIMdstas; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719939317; a=rsa-sha256; cv=none; b=JvMJ8QcjEXykITi45hEPNJHoU6Br+OilF61kfRG0aKIX58g5kwqfMT0vswg68WqNpTido3 B8vL5dC0EPLZE63ER9qsjduznnc2jkrNc+mtDiulHcjNivOXc1s/ecfzaHIRnW0sd5WoSr 6pEaN1uFoSqWrJ/IyNUoCbOhKDIRjHBT8O2j7P6U25cfZZkN6m1BsQWu7euaMaz6ERkLU7 868lOMdgf7FC67EcBCw5jnqyBdE4CAQv/k697CxhkMWrjHBOPrTnnVw3C6ss/WH16EEG/y aX88pKb4nHUDFtXxG4bVl/TCoiv2uxSmQSl8rue4ZkdpvVvbwQmDp64LOOj7gw== 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 F15216959A for ; Tue, 2 Jul 2024 18:55:16 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOgmN-0006QE-D4; Tue, 02 Jul 2024 12:54:55 -0400 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 1sOgmM-0006PO-7z for emacs-orgmode@gnu.org; Tue, 02 Jul 2024 12:54:54 -0400 Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOgmH-0006B3-3Y; Tue, 02 Jul 2024 12:54:53 -0400 Received: by mail-ua1-x935.google.com with SMTP id a1e0cc1a2514c-80b76c5de79so1147595241.1; Tue, 02 Jul 2024 09:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719939287; x=1720544087; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VmCIVWqSEaQqVQAYYGl1m2U8qdWzFxa8033e6oYKOQ0=; b=fIMdstas5SstK9Wnlj9pEyhH/+82wNOtPnTh6F10B0pEszZ8Tp3N/ozBW20aAflF4z mTjZoV088EgCyyi+s7Fxf8GOC/EC/r0dVMFFicuERXb/Y26zrZPpGXZa/DnD/01vfYDK u3NMiPrnmSF9LDygwassY5JX/qD+2WZ+bCAEwOjNTQ9B74g+fU50al7RY48D7K6PV9mF Pbi4uri4ybOJgP/L1WM0eIm6JzaIgt/cHZqaqXzr6SgLvZpJWWZ1eOlp3yDmEEzf34Nq zjzFpJlkOxZnhwwEcmLVA5uVEgfSAS/tJziTfhsmT7BCAdB1g6ahydkZK3IbzMayM+Q9 W1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719939287; x=1720544087; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VmCIVWqSEaQqVQAYYGl1m2U8qdWzFxa8033e6oYKOQ0=; b=uSjuqNGr2L9AuZqsY/WecUH3Q8ySb4wXVFjJpEMkeau/sGp9nfqGPYKVXD50ZU7xVk 1S2JTBYO4gcRa1kSXpDN3X3fTlP5ozaj5C4FeEgyCTQUAYvij3xBmyxNJ+FWobsyL7vV U084Lb8OIBwjXYpLYUlUkbgn3Hytmpso2r5P2DWjJMmEGHkSGskqmTnDLSwrz2Yt31kC LVtfN1/prW8+IMbhKSfM3wVzwe5Yg38nBOyZAVjduZyE4XUfzfqfHbgPP4H6OpxSG0lA DRiDXqdmzIDm9iAr9ZDe9LX5+/dBFF9UkDNSROFNmOnpmsUAdahMklEU9BygKbPDLAjy cv2A== X-Forwarded-Encrypted: i=1; AJvYcCX2zHZMIagFoyP69LNP701Kt5MjTpa9aL2EKBJvP89HV2B+hbA6s5JptOEi0uCFxCHL+8en0e/btRB+5x+0AIugvnuUT2I= X-Gm-Message-State: AOJu0YwItwv6cN7X0Q4dyObXXfwm00vGUKNdUJC06EjADse3Ya0sk/pS Xcp6nMVYMH7hHg5pJPo/Yp4ErBnQUA95DzruXPg4xVTbLnaZvx4cWZHbJGaLPRUc6AqG5fVcHIo qM0XvFPaIFaC3FttQOhthlsa4Sdo6WZ5w X-Google-Smtp-Source: AGHT+IFSln4lAfk5dpdc+WRCwUj1cRw3z4X3VeF/gd9hDjt/4q4ciRm6zs2ODyloNcoeTwaLJHLwAyRqC9J58lS5bqU= X-Received: by 2002:a05:6102:24a9:b0:48f:4396:389f with SMTP id ada2fe7eead31-48faf140bccmr9991376137.24.1719939287474; Tue, 02 Jul 2024 09:54:47 -0700 (PDT) MIME-Version: 1.0 References: <86ed921oxu.fsf@gnu.org> <874j9vllbp.fsf@localhost> <87o781t676.fsf@localhost> <874j9qs0wh.fsf@localhost> <87ed8mtyp0.fsf@localhost> <87msn7kffy.fsf@localhost> <87o77my9mp.fsf@localhost> In-Reply-To: <87o77my9mp.fsf@localhost> From: Daniel Clemente Date: Tue, 2 Jul 2024 16:54:19 +0000 Message-ID: Subject: Re: org-encrypt-entries is slow (was: org-crypt leaking data when encryption password is not entered twice (was: Please document the caching and its user options)) To: Ihor Radchenko Cc: Eli Zaretskii , emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::935; envelope-from=n142857@gmail.com; helo=mail-ua1-x935.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, T_SPF_TEMPERROR=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.73 X-Migadu-Queue-Id: F15216959A X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.73 X-TUID: mQ7R2bOfNeXA > > For instance, I don't use it because it adds around 5 seconds to each > > saving of a large file. If it were instantaneous I would enable it. > > With it disabled, this explains why I often find unencrypted sections > > at the end of the day=E2=80=A6 I have to rely on myself to reencrypt th= em > > again. > > Does it also happen when you use the latest Org mode version? > Yes, with today's build. It happens with an 11 Mb Org file which has 19721 headers (some of them reach level 13). Here I enabled the profiler, added a space, saved (1 time only), and reported CPU. It took around 5 seconds. 4616 89% - command-execute 4349 84% - funcall-interactively 4127 80% - save-buffer 4127 80% - basic-save-buffer 3931 76% - run-hooks 3931 76% - org-encrypt-entries 3931 76% - org-scan-tags 3931 76% - org-element-cache-map 1764 34% - org-element--parse-to 868 16% - org-element--cache-put 848 16% - avl-tree-enter 840 16% - avl-tree--do-enter 792 15% - avl-tree--do-enter 748 14% - avl-tree--do-enter 688 13% - avl-tree--do-enter 632 12% - avl-tree--do-enter 576 11% + avl-tree--do-enter 52 1% + org-element--cache-compare 56 1% + org-element--cache-compare 44 0% + org-element--cache-compare 4 0% avl-tree--node-branch 44 0% + org-element--cache-compare 48 0% + org-element--cache-compare 580 11% - # 448 8% + org-element-headline-parser 20 0% + org-element-section-parser 4 0% org-element-type 136 2% + org-element--cache-find 20 0% # 16 0% org-element-type 12 0% throw 8 0% + # 8 0% + # 4 0% org-element--cache-active-p 1161 22% - # 857 16% - org-entry-get-with-inheritance 797 15% + org-element-lineage-map 8 0% org-element-at-point 8 0% make-closure 8 0% org--property-get-separator 4 0% mapconcat 184 3% + org-element--property 16 0% + org-get-tags 8 0% + org-encrypt-entry 8 0% org-element-begin 4 0% # 4 0% functionp 446 8% + org-element-at-point 200 3% re-search-forward 124 2% + # 44 0% + # 28 0% match-data 12 0% make-closure 8 0% + org-element--property 4 0% # 4 0% org-element-type-p 4 0% # 4 0% throw 196 3% + basic-save-buffer-1