bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00e


From: Eli Zaretskii
Subject: bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014).
Date: Thu, 27 Oct 2016 17:38:50 +0300

> From: Clément Pit--Claudel <clement.pit@gmail.com>
> Date: Wed, 26 Oct 2016 13:15:14 -0400
> 
> Note: inhibit-compact-font-caches doesn't solve this problem (was it supposed 
> to?).  Reverting the commit in the title causes other crashes (24790).

The problem with reverting that commit is that you reverted too much.
The part of the commit shown below cannot be reverted, because the
code it fixed was inserting invalid data types into the font cache,
which then caused rare segfaults such as the one you had recently.

So put back that part of the changeset, and if your performance
problems are still solved by the rest, we might just revert the other
part on master, because no one seems to be able to reproduce the
problem with empty vectors in the font cache, which that part was
supposed to fix.


diff --git a/src/font.c b/src/font.c
index b49664b..e99141b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2804,7 +2803,6 @@ font_matching_entity (struct frame *f, Lisp_Object 
*attrs, Lisp_Object spec)
        && (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
       {
        Lisp_Object cache = font_get_cache (f, driver_list->driver);
-       Lisp_Object copy;
 
        ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
        entity = assoc_no_quit (work, XCDR (cache));
@@ -2813,9 +2811,14 @@ font_matching_entity (struct frame *f, Lisp_Object 
*attrs, Lisp_Object spec)
        else
          {
            entity = driver_list->driver->match (f, work);
-           copy = copy_font_spec (work);
-           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-           XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
+           if (!NILP (entity))
+             {
+               Lisp_Object copy = copy_font_spec (work);
+               Lisp_Object match = Fvector (1, &entity);
+
+               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+               XSETCDR (cache, Fcons (Fcons (copy, match), XCDR (cache)));
+             }
          }
        if (! NILP (entity))
          break;





reply via email to

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