diff options
| author | Eli Zaretskii | 2015-11-07 15:32:45 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-07 15:32:45 +0200 |
| commit | fc61ea4fd744480dcd5cd174f4599e135752882a (patch) | |
| tree | 19cdf0cf369c47385c7e0a759506107af6f096c9 /src | |
| parent | b74c8847e86a9fc2abfe3a80e75cd361ce2d53af (diff) | |
| download | emacs-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 'src')
| -rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index dbc2d840d44..30dfac55601 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -623,7 +623,8 @@ bset_update_mode_line (struct buffer *b) | |||
| 623 | void | 623 | void |
| 624 | maybe_set_redisplay (Lisp_Object symbol) | 624 | maybe_set_redisplay (Lisp_Object symbol) |
| 625 | { | 625 | { |
| 626 | if (!NILP (Fassoc_string (symbol, Vredisplay__variables, Qnil))) | 626 | if (HASH_TABLE_P (Vredisplay__variables) |
| 627 | && hash_lookup (XHASH_TABLE (Vredisplay__variables), symbol, NULL) >= 0) | ||
| 627 | { | 628 | { |
| 628 | bset_update_mode_line (current_buffer); | 629 | bset_update_mode_line (current_buffer); |
| 629 | current_buffer->prevent_redisplay_optimizations_p = true; | 630 | current_buffer->prevent_redisplay_optimizations_p = true; |
| @@ -31478,7 +31479,7 @@ display table takes effect; in this case, Emacs does not consult | |||
| 31478 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); | 31479 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); |
| 31479 | 31480 | ||
| 31480 | DEFVAR_LISP ("redisplay--variables", Vredisplay__variables, | 31481 | DEFVAR_LISP ("redisplay--variables", Vredisplay__variables, |
| 31481 | doc: /* A list of variables changes to which trigger a thorough redisplay. */); | 31482 | doc: /* A hash-table of variables changing which triggers a thorough redisplay. */); |
| 31482 | Vredisplay__variables = Qnil; | 31483 | Vredisplay__variables = Qnil; |
| 31483 | } | 31484 | } |
| 31484 | 31485 | ||