From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id eI/UKOzmLmay+wAA62LTzQ:P1 (envelope-from ) for ; Mon, 29 Apr 2024 02:16:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id eI/UKOzmLmay+wAA62LTzQ (envelope-from ) for ; Mon, 29 Apr 2024 02:16:44 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=YfyAZVdh; 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=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714349804; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=kMaRzMRHhCcoNtnRq7glBe5Qj2Xn3XHYyK101uwKLr0=; b=UdjeJw7Ww++b/vYbUcjFwG8N0oPH/MhGD+XgtZ8SrmGrGCUlN4L9erbNbBeSzHbWdb5xfp 95W5Yz+BPQEprSJ1oxLamsSmwfXLevaszmbS78nxKjMfOYO6OlkxNKYr/b010MzfaRD1wx 7WhLfKl1zEahi9oRVlRB2CltWlqgmR9SwjbP1gbhXf+bAGgIzE5rQt6FmuFoxZYaZtGX5K IJE+mjmvvpg2VsDTSd0okj1P1iiF9YpDMkZ25Zw/G9jlqYXACxHoqTGk4xi1jhxY/tJ0C2 nPc28n3av7wlXvT2rTJDoj5S5FcwsXDPXarU/+qn9JhMwkFTj8FKrGIun5TvRA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=YfyAZVdh; 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=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1714349804; a=rsa-sha256; cv=pass; b=rbUEhFtbp4zZAJ4ccUjTelHU1lS1NDip7SgbDEAPEWVudwVjF5TXh/1sfKd6F1nqBmZvFY dgMztlzkXDChRyyOVZpkjBBEMM0/dzqHNUxhHN5zdB97POhkCUVe41uhk8hf0/MF32CTrl zg7GivH/tSCLR1/K32wztqZYsWNPIRk2AeYKCMbxAaf9am7l2mSrHDo2m79vCofjpZozYM QiM1rXbs31TMQKkMm60kIRTHA/ybGKRKJtNb/kq6xsGPAK/F63vACXdYrat3uMY1F9PxMu BAn1OmnGAOjkA0yasxbTusoEBV9mkx7/QSSrpQT9axIK+J+DoBDoF15Gvb0ukw== 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 4418C71266 for ; Mon, 29 Apr 2024 02:16:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1EgK-0005lC-3w; Sun, 28 Apr 2024 20:15:44 -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 1s1EgI-0005kn-89 for emacs-orgmode@gnu.org; Sun, 28 Apr 2024 20:15:42 -0400 Received: from mail-co1nam11olkn2029.outbound.protection.outlook.com ([40.92.18.29] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1EgG-000803-Fm for emacs-orgmode@gnu.org; Sun, 28 Apr 2024 20:15:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6sSJzERaPvYHwWK9KW8ym68t/dmlcS+NQ6+/Y/y+G/bE0hnySjp9yXQVMvcAHsrbmPoxpfE0bMVa4Q/SLx+/GmGwq9UijeXGRHnYUDYzXwlaS2G3d9n8z2upBO5u8dfFy0QNByj9/qtWUnIrN5064FV4idumxSm5YwUc04GH59Lm2GlUHTA3wP1aNVUM7NZXKwTuBCsWwFj8C+neG3jmGs6DORNJizc10XIOydc397VYSnSd5xejdOh4mtljRF2j47KuGr8jWJsqzCwawSTMquD1kgzsfyePa3DQhkNgXNJ7HpgWSNIW0Vl+wZB1JpIHYRgD5H5uyjkv673ICT8hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kMaRzMRHhCcoNtnRq7glBe5Qj2Xn3XHYyK101uwKLr0=; b=EaGnKyX6B4iwU6w2L4tvd9XeTO4DbDqF1NkgKmauthNrnE6vhshiO6hTgOevErLpsdwAqtr8xRAvC8UW2CicykL3IXvWISVp6cqmyWJ2nOtLnfeRJDA6RAuxS/fy770m4VjFzXT6X67jVuIDTChCzhsqRbVZ0LkHR9pDW9tCzsOaJ1ly/IE7OjyY339NP3NNAREVQ5uQiYmoWRmPi7wdHZG2OnBrD/8MP8i8OL0HUF58hr35rYA3uzSVSEUQ5PjI4BGYrqOIfnaxElqwNHKV0fTS6RSkNlZ+6zkGYKN3EIaoCAQd2Bg9G6noCwS6b0VltQcx4pa04ZIepCE5SxmPhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kMaRzMRHhCcoNtnRq7glBe5Qj2Xn3XHYyK101uwKLr0=; b=YfyAZVdhD7Kys2rhY0XSQwiW5FBcES5MVnYlcNRNnuTnyHGEVQow+oa8nlPEGxMKnT5QF2gDHieIruWA2C+Polj5l/dOlpsPtIvT9ZwCREJDsb3bIWFYx8iWQQPq47oLEEWJp4PhFXlWhjs5ybykQDB/CP2/dxjdJl6T4Q7Oi7EZWY5H1kgvZ4TNmvk+9UZvRkvcc6aq8iySVZcjNdD0swnFCxMGzOvIhGaJ8iKQgr2uPliYiDcsDMCGWjC1DQzfO1PZsmbULEmf+2OynwFfVZAQWpo50GqutuW0dqgrxuspYBhJzFJxs41VtmxIFZyHyCyir4QkBZYab9Bunm9C3Q== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by SJ0PR84MB1917.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:a03:433::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 00:15:37 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45%6]) with mapi id 15.20.7519.031; Mon, 29 Apr 2024 00:15:37 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Cc: Morgan Smith Subject: [PATCH] org-make-tags-matcher: Compile returned function Date: Sun, 28 Apr 2024 20:06:48 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [d1RWba7I5J6DwG7H0G27AyPomike1z6h] X-ClientProxiedBy: YT4PR01CA0089.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::14) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20240429000647.6378-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|SJ0PR84MB1917:EE_ X-MS-Office365-Filtering-Correlation-Id: 3021de10-1c62-42df-0f2d-08dc67e17eb2 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: TDjhYCubU5PL6UsIL9j66sLsI7cr/Ho00ExJ5VUcnu3UYHv4KjNi0iw8Km4QEFDJrTAJoIAOWsZPN6ZNln6hzgfac8DY1sIdOu+bsLYqlx9qcNLEBOoF3WV800fY51HgXd2dcNZaO1YnZqWBt+1rvvz5jnaVv/0hWa/N2GhSkwTLA9lzMd4EQL6xUrxFREsnNf+l7alKhIdzJps+MQVVXsJx4lbY1e+5LwLi4wjfhva6tPyAWFel6wLl1hvEPLAVC5sxxs5oS8+u4mcnZlsJ8zaKti1RvMhMuxtle+B9b5RwIXVcPyK5rXY5EiuTXaF9g6YHdJF2OfJ1pfCld5xQZDBZFnFXio8PuIazxhwpHK7tuhjWybESHkMUY6N5Z2SF5vPa2f7KSCbuGdkmcmrKlzfPnjwwYDYWNlC28DzC0cy7q6dOFfGBZjnrbAJNEaYZDVVsxE0odktuY/EWyEbYst+zJFUiB4EuHmqZ7laeRZZPxJQCRy0Av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qVxiLzyMH1?= =?us-ascii?Q?CWkPH9YFj9aQKnX1W7uZn5fmylknzHLuAiU2pi7Bb5poYP4zk5APho6mjm57?= =?us-ascii?Q?ZOqJno8VrYqnIxXkXBzUPDLv07lb3rnrmfrpeWZAr9TzrTjAuKH2aBo1FQQo?= =?us-ascii?Q?29eVfQsYTpw7zPbol7VZGHuckPAFXEBbJZ06BCMk97oRybHvl/SyV/OhUNwa?= =?us-ascii?Q?Z7tK50uqC8KQlN4H6g/5h2AIyc/ZQ1hHpaNWMrqPmjljEA6FpNnlePgVXvgG?= =?us-ascii?Q?QuZ/81b3oRsunFK2YC2Dcp09AXVzoOrw2EKKG8tjOXnipPLy7EfnqEPeliep?= =?us-ascii?Q?NMCwOkNcSDPhO4BQuY+hpjxQCqBUZt/k3me/MisO96zFFbr4Juezz2kFDPvU?= =?us-ascii?Q?ZysDU+iY6KRycgOOKLnJHw4ns1YDZCLPnehlpGAqK+MwzRb0xAbHNys4pvja?= =?us-ascii?Q?y0iUHb2cOpKGsFGB9dUvEs6k3o8UNb2sj85SBTbgJDF/S1KYxvm++HxB+8X6?= =?us-ascii?Q?10fislqgkWKJOmFxaOk23duWtltL7HZkDTCi6o0EyK3xdeZeobi9Q5ZLcwnD?= =?us-ascii?Q?+phA8ivYT2BvlWXXgJ3F?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3021de10-1c62-42df-0f2d-08dc67e17eb2 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 00:15:37.3131 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR84MB1917 Received-SPF: pass client-ip=40.92.18.29; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM11-CO1-obe.outbound.protection.outlook.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.29 X-Migadu-Queue-Id: 4418C71266 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.29 X-TUID: vYQz5BNi6dHH This should result in a nice performance boost when the function is called repeatedly (as is often done). * lisp/org.el (org-make-tags-matcher): Evaluate returned function to compile it into a closure. --- Hello! All tests pass. I don't have any rigorous benchmarks but this does make things significantly faster. This actually seems to have a bigger performance impact on `org-clock-sum' then my rewrite of `org-clock-sum' I submitted earlier does. Which is a little frustrating honestly. It does involve using the `eval' function which I know is a little taboo. Although in this case I don't believe it actually adds any danger. Thanks, Morgan lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 084132fb3..80ffeeccf 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11726,7 +11726,7 @@ See also `org-scan-tags'." (or tagsmatcher todomatcher t)))) (when org--matcher-tags-todo-only (setq matcher `(and (member todo org-not-done-keywords) ,matcher))) - (cons match0 `(lambda (todo tags-list level) ,matcher))))) + (cons match0 (eval `(lambda (todo tags-list level) ,matcher) t))))) (defun org--tags-expand-group (group tag-groups expanded) "Recursively expand all tags in GROUP, according to TAG-GROUPS. -- 2.41.0