From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MNPiMn6PX2TMowAASxT56A (envelope-from ) for ; Sat, 13 May 2023 15:24:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YAjKMX6PX2Q0rwAAG6o9tA (envelope-from ) for ; Sat, 13 May 2023 15:24:14 +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 592B53A61C for ; Sat, 13 May 2023 15:24:14 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxpDd-0008Ry-8R; Sat, 13 May 2023 09:23:29 -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 1pxpDc-0008QU-1N for emacs-orgmode@gnu.org; Sat, 13 May 2023 09:23:28 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxpDZ-0008Kh-CV for emacs-orgmode@gnu.org; Sat, 13 May 2023 09:23:27 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-64ab2a37812so10344448b3a.1 for ; Sat, 13 May 2023 06:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683984203; x=1686576203; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:from:to:cc:subject:date:message-id :reply-to; bh=JH5hMISKH/8Jbh/0LrKrQJjWSNcxp82N7EOHW+Mi4gs=; b=qad48CX6aheYUlXyD/mqqzl3sudju/KTwRGz0XhnOn4WKQq4l0iYZOpAbUV1+24s0a cpZ71KbQkEhIQjkCOC65VTDLAcXZWzaLxKs5eKHBKGM86SAeLFkNjz6+MuQhqoXQjz1x Q9eM2/HEvlcnjQp4SMjTy4b1r8WdENeA7HYik94ZxcemP7os9Lm2sL/t0GXGdaDDtFbA wIYYpaU3mDcpDf7B1yDBmy228RONKWkDq4jA1TVb8TpTqjgI9DCkgLKcJBCZY8l3Lhtu MFDRXFyWiMx/aBtiCZ0mJp2M8uHJ8xJ9VjVOl5INH0Nfjpm3TJp7vMk4gzOaaOUDET50 o4Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683984203; x=1686576203; h=mime-version:in-reply-to:reply-to:date:subject:cc:to:from :user-agent:references:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JH5hMISKH/8Jbh/0LrKrQJjWSNcxp82N7EOHW+Mi4gs=; b=TgeMu0wyZyo+wrYytqeE/uUyprh4xRowEpml3ZV1++JpY2wm1pa5V3AnCd5NVB+Ubi T5JJjVtnXlXa+OtrgY0heBCYjoMUo4cjQ3yisyvNgngIOaKz5HrQzDo3vO2R/wh33MgE vgKguymKuK0W3h1gBY2ENWCC5qNTbSt+M+DYnfetRJBLTc2/mr/qKw6J2OMpbFN6GzHB 3cqFg0XMBHlDrFPqb9sBsQxN8QlTQ/LQbK3ID9ueJf2U384jMh2ba2MhvH6YhWdf8jCc zGUpqEAgAEulQ/g7f8BczC3knceI7lKSHioYNUNJ8CnXplu0Xv69MHAQbrqyasXvFphl UooA== X-Gm-Message-State: AC+VfDx0GpEvBQJhM9s1VdUSvy4MIV3yfsOYAWY3DlMtFOfri2ffA0O9 EllQpiH030Mr6LbhU4gD+hWDo0CjD1GG X-Google-Smtp-Source: ACHHUZ7PhSCM62a84K8AUDZk5cwBCTPBUyQMdmuAOeVRGbsC/ZHq5Zy//tcoZ9aTNeu0/7XD8tp0YA== X-Received: by 2002:a05:6a20:1591:b0:104:950f:fe02 with SMTP id h17-20020a056a20159100b00104950ffe02mr5799176pzj.21.1683984203390; Sat, 13 May 2023 06:23:23 -0700 (PDT) Received: from Mac-mini.local ([39.171.215.147]) by smtp.gmail.com with ESMTPSA id c4-20020aa781c4000000b00640e12b6464sm8930552pfn.178.2023.05.13.06.23.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 13 May 2023 06:23:22 -0700 (PDT) Message-ID: <645f8f4a.a70a0220.2f7dd.25e7@mx.google.com> X-Google-Original-Message-ID: Received: by Mac-mini.local (Postfix, from userid 501) id A912E8D0FC9C; Sat, 13 May 2023 17:41:41 +0800 (CST) References: <878rds1xta.fsf@localhost> User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Ihor Radchenko Cc: stardiviner , Org-mode Subject: Re: Improve the performance of `org-set-tags-command` on large `org-tag-alist` Date: Sat, 13 May 2023 17:39:37 +0800 In-reply-to: <878rds1xta.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=numbchild@gmail.com; helo=mail-pf1-x435.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, MSGID_FROM_MTA_HEADER=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: , Reply-To: numbchild@gmail.com 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683984254; a=rsa-sha256; cv=none; b=dic3SCxAfZzeWyFmmfK1AkkCyzb/UfzlInBfR7S5qHnvwgOXtUml8shMkGmCQJRG3skKRP I5f97We2a7TBULw5y1JgMcq/HLZlmWWjoUDK635olnGGYEjQj6bZCKFiG7AThsJ9rqhzu+ jPEwJkls8QKYu8ovXJlvOYFmHgO8NuTqZMicDTLM55LqKzDWvXUGXd9M8rt4yQDv3omoVi lEPHG0ED3CafNLn+Qe4UhQEwGFiB5mFPYO72+hrrRRXzPQS1AREBm6dcZRMnivKXEeH/wO xvG6TGU2AxfbVGUia5uPYd5j7qLFKNwiNU9amWgm18g5y/6kVzXP0rv+tZJsvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=qad48CX6; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683984254; h=from:from:sender:sender:reply-to: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=JH5hMISKH/8Jbh/0LrKrQJjWSNcxp82N7EOHW+Mi4gs=; b=lhTrNcIAcbORkNVfqCAgRU7PW67R0n3ohwNdBoFjdixDtsbVn8lkDife1yAesK8rMnlP2i 0RXBtZ2V+0ypV2BRu02avA8UQNVPxpbu3LUFUu3OSh0QlyPQDQhmpeXdVdXR7P6aX/r3sW xFbpab8UXjkIpiuq8FBvl74QU272iLt5l25ifbdYbS775gtMFmVv2GOfkyCywyCpmKqArM 2PC6F7ORo5ZLFQdnkk/y6hvSJ81SITV5VR2JkiAX8Bh1HZxciiJ/+DaSgIBgM14mMkp5B3 soEJ2G8McBEFbgzPSCUOK7O0LEiO3O4IpUvkM8cq9LWzLMWC1eQgJgGGPlnKVA== X-Migadu-Spam-Score: -12.97 X-Spam-Score: -12.97 X-Migadu-Queue-Id: 592B53A61C X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=qad48CX6; 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-TUID: WjBKea+d8ItR --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ihor Radchenko writes: > stardiviner writes: > >> I have a large `org-tag-alist` value that contains about ~7000 tags. >> When I press [C-c C-q] `org-set-tags-command`. Emacs suspends a long tim= e. > > Indeed. That's because `org-fast-tag-selection' tries to put all those > 7k tags into tag selection window. > > We can probably limit the maximum number of tags in the quick selection > window. > > Can you try the attached simple diff for `org-fast-tag-selection' and > check if it is enough to solve the hang? > > diff --git a/lisp/org.el b/lisp/org.el > index c148409d9..d745fd01e 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -11765,7 +11765,7 @@ (defun org-fast-tag-selection (current inherited = table &optional todo-table) > (org-fast-tag-insert "Current" current c-face "\n\n") > (org-fast-tag-show-exit exit-after-next) > (org-set-current-tags-overlay current ov-prefix) > - (setq tbl fulltable char ?a cnt 0) > + (setq tbl (seq-take fulltable 26) char ?a cnt 0) > (while (setq e (pop tbl)) > (cond > ((eq (car e) :startgroup) I applied your diff with a testing. This indeed solved the performance issu= e. Will this be updated in Org-mode source code? =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRfW1UACgkQG13xyVro msMoGwf/UWGUGcN7DYRQkLGI4ilfAJZD4DLYAJvAjJfYaw/vri6dDGHo8WplCFcg JX9G0vqqbpmw4LYGcD8n7MN7NxalltGtp9kI9IoH8JOtzjEVDxzbbNzXZ0zL6BhN zW/Ep8mOLju7pInIwfRYAt8waBj4l72Xg/eeC5lOOeF/Tpy5C6twDT/sxGdwJjEL UupjGpC+uQzf5vAiPz107WGyKs/arxdXQZw8Q/jzU6MGu3Umf5ZYPcMil6VVc5a7 fwGx/DkAcIIHyHH+If7+CQeM7TAQJEN5QkiDzTZ3Pjix8kpGsVYEn6r7CsDVXnYH qMPN5ZQm4WWAfhMHQBLpeNXQSI3EhQ== =i4Bg -----END PGP SIGNATURE----- --=-=-=--