From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OCrmIKJ+KWPBwQAAbAwnHQ (envelope-from ) for ; Tue, 20 Sep 2022 10:49:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0LLZIKJ+KWMCiwAAauVa8A (envelope-from ) for ; Tue, 20 Sep 2022 10:49:38 +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 362E1291F7 for ; Tue, 20 Sep 2022 10:49:38 +0200 (CEST) Received: from localhost ([::1]:43296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaYwi-0006JD-M5 for larch@yhetil.org; Tue, 20 Sep 2022 04:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaYco-0004f8-Fd for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 04:29:02 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:33487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaYcm-0000cL-F2 for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 04:29:01 -0400 Received: by mail-pl1-x62f.google.com with SMTP id iw17so1693515plb.0 for ; Tue, 20 Sep 2022 01:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=1J8USsagSOU0wVgmM4VRUQIBPYjSOEm4wKWa5y1Qx/8=; b=TnAp/w8A6vNxNIIf9z/r4hZH7yTRqIHo8iiReGpt4AdNfVVZqlzDjbxw+RtJ7lRB2S pD22VnUok7XgJ4Lbh+oLBtvaCAJPketdVtQCnFdwze7jxqlfxG7wR+6b/I+i5Tu2RIvk URaaxVaGBFCw/rGYiHO5CDDdy36v4RRVhNDAWra1+pMPCufN8erb5E1yihgom8k8JI0T ZDGsRY+6qa7W//gm+KPPhfuLGZ9DCiqTO5I6hOSPHBEei1lLoAYZK/Y3h3nYD3z0XG4l 5kz3XE+nub+5ToWxlWladfj9/LI3GhZdjqYuTUtH0ToqXZD+yzoakUBGrPO/UPWsTVgT yiaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=1J8USsagSOU0wVgmM4VRUQIBPYjSOEm4wKWa5y1Qx/8=; b=Zadpp1Ld7uqE0bVpe9yO3hMMq5hv0Mog/NoHqUl1GOH9NCJ4k0F3ML+819oxrVC/1M yiOvrGibM1oKNwPPNNGbqnP0RJbVKO0GfuW0CiuaPCUePGkBd/TZiyywJDNVnx0D6Vp3 2nXTtpjFynrXQvLN+9CXHYtCRkR/TW4Vj0n4KabmEuTbgvRRUzziD6F81Qo3XZgWT0PY qr1oRqBOZYyMARoC6jZr25R0OzYWVjqmB+1eraPkwbSFbtV+W0mUia+wJ/U9F8spgZ3b m0oEtIojJAF1gYdu0dzQDoZaq24F8aiVIa0CBW6stFYRhY2eHI1oy/ll9JI0t1bXfyIS Fewg== X-Gm-Message-State: ACrzQf14SISDf6rtrMEo4Tw35n4ee1NjkIl4VTL/nTShsyobVTDTukQk OFl70sjwjKWnpxTanzOw50/NRuoIPDIQDw== X-Google-Smtp-Source: AMsMyM4G0QloqQ6w+vdG7O4r88uKCOtZXRE2hBDUoHP7WudJIZrUG2ZUPvjnto8yavIo7wBNXSJDXQ== X-Received: by 2002:a17:90a:1d08:b0:203:721c:f1d2 with SMTP id c8-20020a17090a1d0800b00203721cf1d2mr2681195pjd.216.1663662539154; Tue, 20 Sep 2022 01:28:59 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id e10-20020a63d94a000000b0040caab35e5bsm882785pgj.89.2022.09.20.01.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 01:28:58 -0700 (PDT) From: Ihor Radchenko To: Timothy Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Babel evaluation: location and timing information In-Reply-To: <87edw9z81n.fsf@tec.tecosaur.net> References: <87edw9z81n.fsf@tec.tecosaur.net> Date: Tue, 20 Sep 2022 16:29:48 +0800 Message-ID: <87r106qwhv.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62f.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, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663663778; 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=1J8USsagSOU0wVgmM4VRUQIBPYjSOEm4wKWa5y1Qx/8=; b=PL0CRVrnjaeDanz4/ByplIiQMj7ux1toux8okamxmSGERFLPJvQ5vE51w56jeCEi3HejwK K8aTaOq9dJM4h+r19PMvPYWLGRzT5csxIhw2ioXWbl/qm2oieFqGwdegcqiUCD7zCkO0o3 ys4CVsUBrxe3DEim+3cEni1hmn09LtSz+6brTNunw6iDN1HJc2gkqE6oWH6RIUn377yTIn TfGn/zLAsq8X+u0Ia+M43hUjyqtJ4JEzlbVTiVJH2iw5OHVDfj4ZqM29BoIGwBkZABvXyd wNV7Gb2d/WSzHofgzUVyQr/mjQt0Tlc/uw0sydvKrQdEGfBwnDAzMd1R0jtqdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663663778; a=rsa-sha256; cv=none; b=PXf6JaP9ZmLYYhEvEXGph6fGfcceJ7LuKArtaB3rOmrcaR/pzs1ziC/hBC5wdhErf+EFX/ 16H83WHcvDK2PkSF0pk1qoPkUqARaZi6OYIFew9+Vji2GJXujZrKwZR7K4HhMWIJ87olYE upEELVJFdBWfkQ3kjg4iXwmn8EMpklaiCsGQ4pEURN6XRPlP9DWDm+AOuci4HMI0woGFl/ 2CoRW7CuecD+ZG1id1K8ruT4WF9oEqX7jjD7HQTqlqmM7uwOBqGtVX9TzFVxYh3YbwXnNa nj4pw9FqjSnvqRWCpyrEXx/18JxwvM3yNL1gNpnU3jLB9tb80mzw6N1iljitug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="TnAp/w8A"; 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-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="TnAp/w8A"; 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-Migadu-Queue-Id: 362E1291F7 X-Spam-Score: -1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: Y8NxgiN+ZykB Timothy writes: > - (message "executing %s code block%s..." > + (message "executing %s %s %s..." > (capitalize lang) > + (pcase (org-element-type (org-element-at-point)) > + ('src-block "code block") > + ('babel-call "call") > + ('paragraph "inline code block")) This will not work, for example, when inline src block is located inside a headline. One can think of various other non-paragraph scenarios as well. Also, even though org-element-at-point should be caching recent calls, I'd try to test the performance before/after the patch on large number of src blocks (like in your config). org-element-at-point can add a fair bit of CPU load in some scenarios where we have fallback to the full O(Log N) AVL-tree lookup. > + (let ((time-info > + (if (and exec-time (> (float-time exec-time) 0.05)) > + (format " (took %.1fs)" (float-time exec-time)) Why 0.05?? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92