org-export-data: Concatenate strings in temporary buffer for performance
* lisp/ox.el (org-export-data): Use temporary buffer to collect export data instead of `mapconcat'. Using buffer puts less load on garbage collector.
This commit is contained in:
parent
3684c79672
commit
a158b263a6
16
lisp/ox.el
16
lisp/ox.el
|
@ -1924,9 +1924,9 @@ Return a string."
|
||||||
(and (not greaterp)
|
(and (not greaterp)
|
||||||
(memq type org-element-recursive-objects)))
|
(memq type org-element-recursive-objects)))
|
||||||
(contents
|
(contents
|
||||||
(mapconcat
|
(let ((export-buffer (current-buffer)))
|
||||||
(lambda (element) (org-export-data element info))
|
(with-temp-buffer
|
||||||
(org-element-contents
|
(dolist (element (org-element-contents
|
||||||
(if (or greaterp objectp) data
|
(if (or greaterp objectp) data
|
||||||
;; Elements directly containing
|
;; Elements directly containing
|
||||||
;; objects must have their indentation
|
;; objects must have their indentation
|
||||||
|
@ -1944,8 +1944,14 @@ Return a string."
|
||||||
(eq (car (org-element-contents parent))
|
(eq (car (org-element-contents parent))
|
||||||
data)
|
data)
|
||||||
(eq (org-element-property :pre-blank parent)
|
(eq (org-element-property :pre-blank parent)
|
||||||
0)))))
|
0))))))
|
||||||
"")))
|
(insert
|
||||||
|
;; Use right local variable
|
||||||
|
;; environment if there are, for
|
||||||
|
;; example, #+BIND variables.
|
||||||
|
(with-current-buffer export-buffer
|
||||||
|
(org-export-data element info))))
|
||||||
|
(buffer-string)))))
|
||||||
(broken-link-handler
|
(broken-link-handler
|
||||||
(funcall transcoder data
|
(funcall transcoder data
|
||||||
(if (not greaterp) contents
|
(if (not greaterp) contents
|
||||||
|
|
Loading…
Reference in New Issue