Skip to content

Commit

Permalink
org-element-cache-map: Do not disable GC
Browse files Browse the repository at this point in the history
* lisp/org-element.el: Do not disable GC.  This can make Emacs hang in
some particularly bad scenarios.  It is better to lose on performance
a bit compared to Emacs GC hanging.

The edge case is described in emacs-citar/citar#397 (comment)
  • Loading branch information
yantar92 committed Sep 4, 2022
1 parent dc102f5 commit 1f1d8f9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lisp/org-element.el
Original file line number Diff line number Diff line change
Expand Up @@ -7337,10 +7337,7 @@ the cache."
(let ((mk (make-marker)))
(set-marker mk to-pos)
(setq to-pos mk)))
;; Make sure that garbage collector does not stand on the way to
;; maximum performance.
(let ((gc-cons-threshold #x40000000)
;; Bind variables used inside loop to avoid memory
(let (;; Bind variables used inside loop to avoid memory
;; re-allocation on every iteration.
;; See https://emacsconf.org/2021/talks/faster/
tmpnext-start tmpparent tmpelement)
Expand Down

0 comments on commit 1f1d8f9

Please sign in to comment.