From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SPTCHkwQAWLjwwAAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 13:27:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2CwbHEwQAWIcJgEA9RJhRA (envelope-from ) for ; Mon, 07 Feb 2022 13:27:56 +0100 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 0AA69EAA6 for ; Mon, 7 Feb 2022 13:27:56 +0100 (CET) Received: from localhost ([::1]:56744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH37b-0000VK-44 for larch@yhetil.org; Mon, 07 Feb 2022 07:27:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH366-0000SB-2T for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 07:26:22 -0500 Received: from [2a00:1450:4864:20::22c] (port=39448 helo=mail-lj1-x22c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nH364-0002Hm-Fc for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 07:26:21 -0500 Received: by mail-lj1-x22c.google.com with SMTP id z20so19319322ljo.6 for ; Mon, 07 Feb 2022 04:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SFkyOsM2bgoE3SrBuh1Of8SZckyAaaTQJaNLXto3M9w=; b=Uda1SxZAcMYH+BfJgmHWBPEzncYjdd0sjb2zwKkZJtSWwLOZt6mJ0CNk+m3kKM5TIq vQD9avRiB9LwR3rUlTNzpD3PFBSqvQFIznMqwgMAVJ3+LUdoyhgAc/xUl2Y6mh36xmlp GdHJlNPqLe1XHqNApCtx+1K1rKTU7xyysJgf8Lt4JDYR28deiwYdA9q8LyX9O0xtj5j/ 0jSoyMqs2fv8Ucrx9v/bMjAZdk5xmeSoFoK/ydkWL8VJcqspCVy0i9P714+ajxHYKyRK dM8Vo0RtOxN5cELOPu1vv/RbnUvKHX9DS4JZttdI8Nr3CpxqZfEGANsyuDKcP8znWO0H W90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SFkyOsM2bgoE3SrBuh1Of8SZckyAaaTQJaNLXto3M9w=; b=EX2HQIL8dxULDYAWyO5zi7fwy9MgK02/fgarOF+1mRKGjfDjvVntv8cLqpp9qUgsVY 7xko8547blJJ5N4g9gKZL8jWSRAF4ti2WxT3LT7uMiGVXb+Am+SyYi+Tm2NEcgCObARD eSPD2QOMAHxHbj1Q81G7WaPQ1D/pC4pUpyE3ufEdLnEtnxo2hBulHGDClLWOe6he/EhQ fS1CNUp7K+ikT++ovzX/fZ7xXMDMrpTFSHpSS0jYBw99D1ZGSEHzK8/++7Wk4yfBdvcK b5YffWdhYyEfGrEQNhOwQtMej66wHSs4IZQ4CV2p2pK9NVPR2DsySSSyAMS1nhcbelRV RfBQ== X-Gm-Message-State: AOAM530BBRfZrdwpBB+vJ+2/si3H2CNggrdOojUiKMawUnhikbAECqi2 Lb0mO0nznEIgKd8SojqsRanIni8L6weeBQ== X-Google-Smtp-Source: ABdhPJxpmkx1Wt4lLNJzmtbN+QQABpgsFyS/P/s9I5lguixjRcFAZj+hRsORT+7aV1DLEQObodNVhw== X-Received: by 2002:a2e:8495:: with SMTP id b21mr8681738ljh.227.1644236778444; Mon, 07 Feb 2022 04:26:18 -0800 (PST) Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id a14sm1479818lfo.233.2022.02.07.04.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 04:26:18 -0800 (PST) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [RFC PATCH 0/2] Make org-babel-tangle usable in after-save-hook on large org buffers Date: Mon, 7 Feb 2022 20:31:13 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::22c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=yantar92@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ihor Radchenko Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644236876; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SFkyOsM2bgoE3SrBuh1Of8SZckyAaaTQJaNLXto3M9w=; b=ZThjEJ/ouFdokCVl8QfsFwIBozsx8sbWPs1JWA9SOClssEChyz3WeIVz+vsM3rgrv2xf3t xVm7cSKN0za9/ourZjKOWdCEnc3ojiJFt6DA4xduItcJtKPwRcdKHxP+ixmCQ+jETfD/FM CVOkuk8J425HUPR0ykmnZazl8hyx/iyYuXbQ885U26ADPg/2gMWQhb8EPiBrDHa4aIzrPX p2KaLr5t2ajXYHqmGoYKkEljIe5iNBoU839wZf776YIhcCnlcoepRq0UYejB8TXhiKyzlj NxnOzLKundWXQD9qmgcb013nBTGqPHS1uXXOOaB74Cmfz0Ze6tv1YUBXXHzozg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644236876; a=rsa-sha256; cv=none; b=abte3FuCGY8DOwyJcILKNg7Bp5eNfeA2iIIAsJjApJaaPHhmTjZnR3TrxeXYROY6SJgchV DMJSP+E0rWeNs3jiVpsVTyboyRRGd4ELDF0uuIvWuTv0srLPwc1rcdC9t9Jo47Z/fViPfj HbGCId+2vBsZiNFunZ8RfPtrtEktG6yVOk2hud9YcgJsoHlXjvY5YdC5r/gFQRteKUpLnX x8f6L4dUtw8/CB0/vAqlNwtH1yFEKTmuIxGoQF+O82wUbkOAdFBRBIi8oPgMLaR1O5zF/A HXsp7fchb3GoWN0zNxnHIPABDSKBxqVcAT60UF8qqaboZd1Y0FN/Kyk13XhuFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Uda1SxZA; 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: -2.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Uda1SxZA; 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: 0AA69EAA6 X-Spam-Score: -2.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: EUVb8m1n8qW/ I would like to send an experimental patch improving performance of org-babel-tangle. The patch contains two major changes: 1. org-babel-tangle-single-block will not try to parse LINK to src block when :comments is set to "no" and simple return nil in relevant slot of the parsed src block structure. 2. org-babel-expand-noweb-references cache will be saved between the function calls (reset on buffer edits) Because I am not very familiar with org-babel internals, I would like more knowledgeable people to review the changes and let me know if I overlooked some unexpected side-effects. Also, testing tangle performance on real Org files with many code blocks would be appreciated. On my side, the tangling time has been reduced from >6 sec down to 0.1-0.2 sec (with this patch and org-element-cache combined). Best, Ihor Ihor Radchenko (2): org-babel-tangle-single-block: Do not create comment link when not requested org-babel-expand-noweb-references: Cache block info lisp/ob-core.el | 225 ++++++++++++++++++++++++++-------------------- lisp/ob-tangle.el | 24 ++--- 2 files changed, 141 insertions(+), 108 deletions(-) -- 2.34.1