summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-11-07 15:32:45 +0200
committerEli Zaretskii <eliz@gnu.org>2015-11-07 15:32:45 +0200
commitfc61ea4fd744480dcd5cd174f4599e135752882a (patch)
tree19cdf0cf369c47385c7e0a759506107af6f096c9 /lisp/frame.el
parentb74c8847e86a9fc2abfe3a80e75cd361ce2d53af (diff)
downloademacs-fc61ea4fd744480dcd5cd174f4599e135752882a.tar.gz
emacs-fc61ea4fd744480dcd5cd174f4599e135752882a.tar.bz2
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/frame.el')
-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'."
(make-obsolete-variable
'window-system-version "it does not give useful information." "24.3")
-;; These variables should trigger redisplay of the current buffer.
-(setq redisplay--variables
+;; Variables which should trigger redisplay of the current buffer.
+(setq redisplay--variables (make-hash-table :test 'eq :size 10))
+(mapc (lambda (var)
+ (puthash var 1 redisplay--variables))
'(line-spacing
overline-margin
line-prefix