aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2015-11-07 15:32:45 +0200
committerEli Zaretskii2015-11-07 15:32:45 +0200
commitfc61ea4fd744480dcd5cd174f4599e135752882a (patch)
tree19cdf0cf369c47385c7e0a759506107af6f096c9 /lisp
parentb74c8847e86a9fc2abfe3a80e75cd361ce2d53af (diff)
downloademacs-fc61ea4fd744480dcd5cd174f4599e135752882a.tar.gz
emacs-fc61ea4fd744480dcd5cd174f4599e135752882a.zip
Speed up lookup in redisplay--variables
* lisp/frame.el (redisplay--variables): Make it a hash-table. * src/xdisp.c (maybe_set_redisplay): Access redisplay--variables as a hash-table. This speeds up this function by an order of magnitude: where previously a setq was slowed down by 100% by introducing the maybe_set_redisplay test, it is now only 5% slower. (syms_of_xdisp) <redisplay--variables>: Doc fix.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/frame.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 4b23cb20ac4..3f31a2973c6 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2231,8 +2231,10 @@ See also `toggle-frame-maximized'."
2231(make-obsolete-variable 2231(make-obsolete-variable
2232 'window-system-version "it does not give useful information." "24.3") 2232 'window-system-version "it does not give useful information." "24.3")
2233 2233
2234;; These variables should trigger redisplay of the current buffer. 2234;; Variables which should trigger redisplay of the current buffer.
2235(setq redisplay--variables 2235(setq redisplay--variables (make-hash-table :test 'eq :size 10))
2236(mapc (lambda (var)
2237 (puthash var 1 redisplay--variables))
2236 '(line-spacing 2238 '(line-spacing
2237 overline-margin 2239 overline-margin
2238 line-prefix 2240 line-prefix