From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id G1zvNx9/71+6CQAA0tVLHw (envelope-from ) for ; Fri, 01 Jan 2021 19:59:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UAAnMx9/71+PSQAAbx9fmQ (envelope-from ) for ; Fri, 01 Jan 2021 19:59:27 +0000 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 5FEA394030E for ; Fri, 1 Jan 2021 19:59:27 +0000 (UTC) Received: from localhost ([::1]:56310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvQa6-0007aT-C0 for larch@yhetil.org; Fri, 01 Jan 2021 14:59:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQZL-0007ZC-0B for emacs-orgmode@gnu.org; Fri, 01 Jan 2021 14:58:39 -0500 Received: from mail-40135.protonmail.ch ([185.70.40.135]:39592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvQZI-0000DD-Bu for emacs-orgmode@gnu.org; Fri, 01 Jan 2021 14:58:38 -0500 Date: Fri, 01 Jan 2021 19:58:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609531112; bh=7DwtbUQkT+KCaXmpgavfriYxzCZa1DaefuIOk8SSz4U=; h=Date:To:From:Reply-To:Subject:From; b=Oe4s9YVwp29HIiOCSTctUoA7530MJmQCtrBEEKjECe0WoHucMYro6+SGiLlQRN/bq DqxTSdoWYfpx8Fu68DbrQctTh4xs79MIJKX5pazjn1Az5O8mAMbB9Y5CF6xa4glrML 4+aWCGxfHfF6EAGgxO3h0lrzusPTnJHP2voBDUMQ= To: "emacs-orgmode@gnu.org" From: Emily Bourke Subject: [PATCH] ox-publish.el: Speed up org-publish-cache-file-needs-publishing Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_3NQ0Ni6fmQINTTozv2pdctSq8XuEonblvcXqqYxVYo" Received-SPF: pass client-ip=185.70.40.135; envelope-from=undergroundquizscene@protonmail.com; helo=mail-40135.protonmail.ch 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_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Emily Bourke Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=Oe4s9YVw; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 5FEA394030E X-Spam-Score: -3.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4A6c5FavGe2N This is a multi-part message in MIME format. --b1_3NQ0Ni6fmQINTTozv2pdctSq8XuEonblvcXqqYxVYo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I found publishing when there were no changes to be slower than expected. P= rofiling showed me that `org-publish-cache-file-needs-publishing' was invok= ing the `after-find-file' hooks, which I don't think is necessary. I've changed it to avoid doing that, by using `with-temp-buffer' and `inser= t-file-contents', and noticed a significant increase in speed. Is there any reason I'm missing for using `find-file-noselect' in this case= ? Best wishes, Emily Bourke --b1_3NQ0Ni6fmQINTTozv2pdctSq8XuEonblvcXqqYxVYo Content-Type: application/octet-stream; name=0001-ox-publish.el-Speed-up-org-publish-cache-file-needs-.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-ox-publish.el-Speed-up-org-publish-cache-file-needs-.patch RnJvbSAwYWU5ZDAzMWVjMzY4ZGRmZTYyOTVkY2U3NmFhZmJkMzY4YzVlYjI1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFbWlseSBCb3Vya2UgPHVuZGVyZ3JvdW5kcXVpenNjZW5lQGdt YWlsLmNvbT4KRGF0ZTogRnJpLCAxIEphbiAyMDIxIDE4OjQ3OjQ1ICswMDAwClN1YmplY3Q6IFtQ QVRDSF0gb3gtcHVibGlzaC5lbDogU3BlZWQgdXAKIG9yZy1wdWJsaXNoLWNhY2hlLWZpbGUtbmVl ZHMtcHVibGlzaGluZwoKKiBsaXNwL294LXB1Ymxpc2guZWwgKG9yZy1wdWJsaXNoLWNhY2hlLWZp bGUtbmVlZHMtcHVibGlzaGluZyk6IFVzZQpgd2l0aC10ZW1wLWJ1ZmZlcicgd2l0aCBgaW5zZXJ0 LWZpbGUtY29udGVudHMnIGluc3RlYWQgb2YKYGZpbmQtZmlsZS1ub3NlbGVjdCcuICBUaGlzIGF2 b2lkcyBydW5uaW5nIHRoZSBgYWZ0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