emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Gustav Wikström" <gustav@whil.se>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: FYI Speedup of publish command in master
Date: Sun, 27 Jun 2021 08:15:27 +0000	[thread overview]
Message-ID: <HE1PR02MB3177DDC78838E0CDD8B3B4AADA049@HE1PR02MB3177.eurprd02.prod.outlook.com> (raw)

Hi,

In a similar vein as the speedups of scanning for IDs that was made a while back, there now is a speedup for org publish as well. Soon to be pushed to code.orgmode.org (we're still using that, aren't we?) with commit aa0fa8c75.

The speedup is seen when scanning through files to decide if an existing cache can be used or not.

A note on the topic, fwiw. Loading an Org mode file using find-file is very slow. So when there is a reason for looking through the content of Org mode files, or any file for that matter, and there is no reason for triggering hooks, consider instead inserting the content of the file in a delay-mode-hooks macro within a temporary buffer (using the with-temp-buffer macro).

Example:
*Instead of*:
(find-file path-to-file)
;; do stuff
(...)
;; clean up state
(kill-buffer ...)

*Consider*:
(with-temp-buffer
  (delay-mode-hooks
    (insert-file-contents path-to-file)
    ;; do stuff
    (...)))

Best
Gustav

                 reply	other threads:[~2021-06-27  8:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HE1PR02MB3177DDC78838E0CDD8B3B4AADA049@HE1PR02MB3177.eurprd02.prod.outlook.com \
    --to=gustav@whil.se \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).