소스 검색

org-element-parse-buffer: Avoid excessive garbage collection

* lisp/org-element.el (org-element-parse-buffer): Increase
`gc-cons-threshold' to improve performance.  In my tests on large Org
buffers, garbage collection took 50% of the time without increasing
the threshold.
Ihor Radchenko 3 년 전
부모
커밋
20ed794b92
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      lisp/org-element.el

+ 2 - 1
lisp/org-element.el

@@ -4478,7 +4478,8 @@ or objects within the parse tree.
 This function assumes that current major mode is `org-mode'."
   (save-excursion
     (goto-char (point-min))
-    (let ((org-data (org-element-org-data-parser)))
+    (let ((org-data (org-element-org-data-parser))
+          (gc-cons-threshold #x40000000))
       (org-skip-whitespace)
       (org-element--parse-elements
        (point-at-bol) (point-max)