emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 58430f2: Fix redisplay performance problems with so


From: Eli Zaretskii
Subject: [Emacs-diffs] master 58430f2: Fix redisplay performance problems with some fonts
Date: Sun, 16 Apr 2017 03:43:49 -0400 (EDT)

branch: master
commit 58430f29968a5661caff630d20dbbe7c864fe08d
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix redisplay performance problems with some fonts
    
    * src/font.c (font_list_entities): Revert part of the changes
    introduced on Apr 2, 2014 to fix bug#17125.  It turns out having
    zero_vector in the font-cache is an important indication that
    cannot be removed.  (Bug#21028)
---
 src/font.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/font.c b/src/font.c
index a929509..dd6191b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2777,21 +2777,27 @@ font_list_entities (struct frame *f, Lisp_Object spec)
          val = XCDR (val);
        else
          {
-           val = driver_list->driver->list (f, scratch_font_spec);
-           if (!NILP (val))
-             {
-               Lisp_Object copy = copy_font_spec (scratch_font_spec);
+           Lisp_Object copy;
 
-               val = Fvconcat (1, &val);
-               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-               XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
-             }
+           val = driver_list->driver->list (f, scratch_font_spec);
+           /* We put zero_vector in the font-cache to indicate that
+              no fonts matching SPEC were found on the system.
+              Failure to have this indication in the font cache can
+              cause severe performance degradation in some rare
+              cases, see bug#21028.  */
+           if (NILP (val))
+             val = zero_vector;
+           else
+             val = Fvconcat (1, &val);
+           copy = copy_font_spec (scratch_font_spec);
+           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+           XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
          }
-       if (VECTORP (val) && ASIZE (val) > 0
+       if (ASIZE (val) > 0
            && (need_filtering
                || ! NILP (Vface_ignored_fonts)))
          val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
-       if (VECTORP (val) && ASIZE (val) > 0)
+       if (ASIZE (val) > 0)
          list = Fcons (val, list);
       }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]