From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id ELO+FE+ZMmYHJAAAqHPOHw:P1 (envelope-from ) for ; Wed, 01 May 2024 21:34:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ELO+FE+ZMmYHJAAAqHPOHw (envelope-from ) for ; Wed, 01 May 2024 21:34:39 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=ohLNr1Pr; 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=1714592079; 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=QvDCC1116Lp55MJR+TRc3AE29+VKtnZnDwd5R+ZH1d4=; b=UD0sWTMxZTS9Z4q3w4Kvqb6JLD5SQz5nrcghWPEISRDmtDfGRjFFp/uNpANgjmCBlKdplr CTl05HTjOXpLhGnEl21C4TfSYDX0uZBwnmuSjWAvZchRE8gQ6qjcg71lakkL2RZMC/UKa9 uw2O6855mU+s1Qrs+Lgl+XsnDSRPZr6DssiH46KfQObQABrVyshl5Z5jXglO5eAWe/EnUw M2klg8ChqXwUMhbTfyygqNwnVuUEREDhI8oCyxJTOdis+NOnsMqJZwVMRtdq/jb8Fz94lg HRh6aXZD6JPpfShE5Qkt7Nq/R+i1upITdHijY7Ia2yI/zQ02b46SuUM5G5c3Jw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=ohLNr1Pr; 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=1714592079; a=rsa-sha256; cv=pass; b=phVSi7OyaiUYWHsQEFL6+oxid8V4KknY2w/uVPqaoQ68pVPGJwxmSTKLFFsoFHgDNZq/zi 1zeRmfZFDiNLb0ut7hOVEzvJ/FwJBVNqHJsHi/vBIY8T2XSWmtAA2KeO1AtR2FeBfDGiY3 296w51G8ODkcu0qBiZ5qafgZj2LpNbkI0PAA2NuHQAOoABVmjue+Sa0JFq+V0yorV5ma6H L+MRGA619uSi2nLfFjRqPLd8BPu9SkjAjoI1/GAmqRDPPwbdghruYPMd3rs9J7tEIPy8VN rUQn+q7hGqxpdsyBtrLNtv8uVi8lixvZ4fEzESFRQVpbr178wBF+CU8mlh0zdQ== 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 98CA43E573 for ; Wed, 1 May 2024 21:34:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2FiH-0002Xz-TS; Wed, 01 May 2024 15:33:57 -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 1s2FiE-0002WU-Oi for emacs-orgmode@gnu.org; Wed, 01 May 2024 15:33:54 -0400 Received: from mail-bn7nam10olkn2089.outbound.protection.outlook.com ([40.92.40.89] helo=NAM10-BN7-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 1s2FiC-0006DQ-JK for emacs-orgmode@gnu.org; Wed, 01 May 2024 15:33:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxeeLEYRJbQMbQIXmyT4SbVMCNTwcthm7tl23gu0C9BIj9z58ZFpABt9PmM0sNHIF0za84oIGfEOXly0knYET7esJ7ga5viCz/fjzTg7Uv7cjYiWSCQkCuKxZmJU96W9S2ZYLdqhj8H0BWDV65Ecb+hh0Mbkqi5ibYLSTLrMXUB98mXa2jMJMyb8E68dbKi8UXEh6irM+e41nvBWVLU3Ko4WPcqPonSMeNAwPDPzPVptybFBSNPNeoEkk/BT8X7qd9+W1Ge1/29YGwIgSKs1eQFeS0CxYwpzpUIJ/+5/wHhHtIK6NUzLCoZT6pwm5D0u2oJDPbEpA3NHf7f3q/0aoA== 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=QvDCC1116Lp55MJR+TRc3AE29+VKtnZnDwd5R+ZH1d4=; b=VbXXjcgilxxeWm671gCA2JKGj6bTXv1OSMipsS4BDXRMLmtKLOvAHkd1NUJ21TurlcfCrSGEmrK3dZmYIPU/FJoWjyOjZGiuXgsmlhS5PdfFoQNMvyPRe2biQcX+wAYS0khuweayrUSqyOcLOmHl86Z3ODKFKxZKFs/d37sggWQ1V9Bm9d5IxZhauvxntiw+/dgdGRjb0V+O7134CKsSuxaXXEKYs+Oo79hC0zEHgLuOT4jsiX2OJDJSz2isIPrZlGlABSxtDBW2uQT0APWLkz/XNlkU1tJnil5ZZ85cbfKq6CnCAKHVzOj9d4KIqxvg+p6pvbBFANN5H19ISy3kxg== 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=QvDCC1116Lp55MJR+TRc3AE29+VKtnZnDwd5R+ZH1d4=; b=ohLNr1PrU9Drnz+QlldKoVNm8hNIhLyI8Hy2ZxQOWkpoTrx2qgrlXeNO/Jk1jGEvjPjZvKDQE8zK1Pta+jqzMI9CkGxe3M/OENJNL/PVxWV0xFtaW+ctiKq4b9DsIAqF2PbPKsVkVIsXtCq9h35hlYAHhQ3JZwybYuEf10In4uQwMkUG3ltCrIv0c/cI0iZKYP+65zl7fevbd08IxrVef0vKsaSwgP3qAY0SPFAbh4e10M/4XL2tK/4kvPCL/ZajzgLii0gCooF/iR4z4XzsnkKA8QAx+wOAZDvTt4piBMBitc8KFj2G8Tv1aB2NOTTnIY6QGF3SZibLknRLVi1XKQ== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by PH0PR84MB1978.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:161::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Wed, 1 May 2024 19:33:49 +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; Wed, 1 May 2024 19:33:49 +0000 From: Morgan Smith To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] lisp/org.el: Obsolete `org-cached-entry-get' in favor of `org-entry-get' In-Reply-To: <87y18tqsnz.fsf@localhost> (Ihor Radchenko's message of "Wed, 01 May 2024 18:43:44 +0000") References: <87ttjkaywn.fsf@localhost> <877cgfywwg.fsf@localhost> <87y18tqsnz.fsf@localhost> X-Hashcash: 1:20:240501:emacs-orgmode@gnu.org::/CKhISEK3QzKUrBI:sm0 X-Hashcash: 1:20:240501:yantar92@posteo.net::cJP2Xl0BZIBNL5rC:5Tf+ Date: Wed, 01 May 2024 15:33:47 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TMN: [EOujsG9FBbXDrDHFKt9oWRBv496kvdXu] X-ClientProxiedBy: YT4PR01CA0460.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d6::24) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <877cgdwcmc.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|PH0PR84MB1978:EE_ X-MS-Office365-Filtering-Correlation-Id: 22b36869-f2ec-40e7-09ad-08dc6a15a010 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199019|440099019|3412199016; X-Microsoft-Antispam-Message-Info: 5cqmrfHiNmOPgxF3MW18LQc1xW8Np/8yC3FA+1e25+Cm6kIVP5jAx9v7UiHhdtp03I9vll74ZA8CjP+e7UmRqDfLjZbZA7PtGsFqumHFMzH6/hgt7zqkcqwBC7MZnjUZjwueLLiDzqjJF571b0fKAt54uJdWrR0xuMdons8bnq4tBfVRvKeuhXe/CUnQpbZvMpRbYd/CHjlbqOY5VIhh3kDN5KDGV6RUtPk4zdieECyrcbvLkap+AMVnjX/1sGhyoTdvCJ5XDz7p7ys6+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uvuf+Q0+v7t1P2G4bmvpork?= =?us-ascii?Q?lijnyWmET5hnsi/02P55XTAVb1Z6n8CpbKY+yeqYUGpOs+22RqaonZl1joSy?= =?us-ascii?Q?nn2/9PU25xHXYhDj5heRqwm3tPXQfya7RhH5M05Cti+HTNntXpbUicqovhT1?= =?us-ascii?Q?DoCqX0QQRkqS87kYdMJDFe+fm6oU3wWNg9Ih4PR6GaLalap576S8ekn0GhuG?= =?us-ascii?Q?v7/r7zUL44+ovLhWN6zwaXv+8eiT8ymEM/cz9y/GbjoiuWujzqNO3hzzcd/j?= =?us-ascii?Q?T0kJcjU4MiGXqwERANK23CQ7YoLYhMFIpOCRQHe3lGzLhcZh5x0uBCRH/Wga?= =?us-ascii?Q?/tPdojWIAAsYMKbYr+27oOM6DOhYbA+CLvVbfExUMP2gQKxgg/XhbDl6dE+C?= =?us-ascii?Q?6t3Qo4QnRPfql4zfAm1hQd5x5qQ8iwcLMgknvEby55W6TPDIzoUMdZtEnnfo?= =?us-ascii?Q?nvGpmC4+R4nDYsz5rM1Adyt7GF9phEGaEIM8nlfT5qR/kaFkdr/DYoonsf7G?= =?us-ascii?Q?hp7egjYP/gmoW8BTe+giIgAA5a0Ivg8kC3+3ToAHHrNIdSGusICILo78K6L5?= =?us-ascii?Q?RlQUi0e93Mcm5p3xi7SaUT2zkVYQC8Gc+e7QFk/2ieuvFSSh0K60poSE36pg?= =?us-ascii?Q?VWl2Baj9zVd7CmZ7ax0dQejWttEKwDkEIvWmeD8HgTxlWy5m0xs/EZ3IpmZR?= =?us-ascii?Q?bB8TNzix7uDCR6mPEFjv?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22b36869-f2ec-40e7-09ad-08dc6a15a010 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2024 19:33:49.4057 (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: PH0PR84MB1978 Received-SPF: pass client-ip=40.92.40.89; envelope-from=morgan.j.smith@outlook.com; helo=NAM10-BN7-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_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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.85 X-Spam-Score: -9.85 X-Migadu-Queue-Id: 98CA43E573 X-Migadu-Scanner: mx13.migadu.com X-TUID: jxy5n50rb1ef Ihor Radchenko writes: > Morgan Smith writes: >>> Also, with the old approach, if you observe slowdowns, you likely have >>> some property being calculated slowly (like BLOCKED in my case). Do you >>> happen to know which property is it for your setup? >> >> According to my profiler, I think it's using 30% of the CPU time during >> my custom org-clock-sum just to get ITEM. I suppose it's because it >> thinks it has to grab and cache everything when all I'm after is ITEM. > > Not sure here. Getting ITEM is just a single regexp match. > May you share the profiler report? (M-x profiler-report-write-profile) I'm experiencing some bugs with `profiler-find-profile'. Might be related to all the type changes that happened recently in Emacs master (I like to run on the bleeding edge so I can experience as much pain and frustration as possible). Anyways, it's not just a regexp match since `org-cached-entry-get' tells `org-entry-properties' to get everything. We can see here almost all of the slowdown for me occurs because of `org-element-context' which is called in the `find-ts' lambda that search's for TIMESTAMP and TIMESTAMP_IA. 8780 33% - org-cached-entry-get 8780 33% - org-entry-properties 8696 32% - # 8236 31% + org-element-context The comment written just above `org-element-properties-map' says this: #+BEGIN_SRC elisp ;; There is purposely no function like `org-element-properties' that ;; returns a list of properties. Such function would tempt the users ;; to (1) run it, creating a whole new list; (2) filter over that list ;; - the process requiring a lot of extra consing, adding a load onto ;; Emacs GC, memory used, and slowing things up as creating new lists ;; is not free for CPU. #+END_SRC This implies that the function `org-entry-properties' is just a bad idea. Although giving it an argument for WHICH does make it better. It seems like it's only used in about 4 places in our codebase so if we wanted to go further, we could potentially see more performance enhancements if we obsolete this function as well. I haven't really looked into it much though so I apologize if my analyses is wrong. Which it definitely could be.