1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

org-persist-write:index: Disable pretty-printing

* lisp/org-persist.el (org-persist-write:index): Disable
pretty-printing when writing index.  This is simply too slow once
index reaches ~1000 items.  `pp' is slow.  See bug#58687.
(org-persist--write-elisp-file): Add FIXME explaining that using PP
argument is probably not a good idea.

Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://orgmode.org/list/87r0axvu7y.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2024-08-10 14:44:08 +02:00
parent b7026cf3e8
commit f9351456e7
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -448,6 +448,8 @@ FORMAT and ARGS are passed to `message'."
buffer-or-file (error-message-string err)))
nil)))))
;; FIXME: `pp' is very slow when writing even moderately large datasets
;; We should probably drop it or find some fast formatter.
(defun org-persist--write-elisp-file (file data &optional no-circular pp)
"Write elisp DATA to FILE."
;; Fsync slightly reduces the chance of an incomplete filesystem
@ -898,7 +900,7 @@ Otherwise, return t."
(let ((index-file
(org-file-name-concat org-persist-directory org-persist-index-file)))
(org-persist--merge-index-with-disk)
(org-persist--write-elisp-file index-file org-persist--index t t)
(org-persist--write-elisp-file index-file org-persist--index t)
(setq org-persist--index-age
(file-attribute-modification-time (file-attributes index-file)))
index-file)))