From: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: 21028@debbugs.gnu.org
Subject: bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014).
Date: Thu, 3 Mar 2016 00:33:42 -0700 [thread overview]
Message-ID: <56D7E8D6.6080508@live.com> (raw)
In-Reply-To: <56D7E2F6.2020008@live.com>
[-- Attachment #1.1: Type: text/plain, Size: 3596 bytes --]
On 03/03/2016 12:08 AM, Clément Pit--Claudel wrote:
> I've reattached both profiles.
Hi,
I've looked further into this. Comparing the profiles, there seems to be two significant differences:
1. ‘deliver_user_signal’ gets called constantly in the slow case, with many calls to ‘x_catch_errors_with_handler’, ‘x_catch_errors_with_handler’, ‘x_had_errors_p’, and ‘x_uncatch_errors’; there are few to no such calls in the fast case.
2. font_list_entities constantly calls xfont_list in the slow case, but not in the fast case:
In the slow case:
-----------------------------------------------
0.04 1.01 554734/554734 font_find_for_lface [14]
[16] 11.0 0.04 1.01 554734 font_list_entities [16]
0.04 0.91 554734/554734 xfont_list [17]
0.02 0.00 554734/2778892 Fnreverse [45]
0.00 0.02 1109468/1109469 assoc_no_quit [96]
0.01 0.00 1109468/1109470 xfont_get_cache [121]
0.01 0.00 555016/1289625 Fcons [80]
0.00 0.00 141/141 xftfont_list [212]
0.00 0.00 141/45490 concat [103]
0.00 0.00 141/138863 copy_font_spec [78]
0.00 0.00 141/6814 Fvconcat [832]
-----------------------------------------------
In the fast case:
-----------------------------------------------
0.06 0.41 1533134/1533134 font_find_for_lface [13]
[25] 14.8 0.06 0.41 1533134 font_list_entities [25]
0.02 0.31 3066268/3066269 assoc_no_quit [29]
0.07 0.00 1533134/7672938 Fnreverse [28]
0.02 0.00 1534750/3266575 Fcons [62]
0.00 0.00 347/347 xftfont_list [209]
0.00 0.00 461/461 xfont_list [245]
0.00 0.00 808/385139 copy_font_spec [50]
0.00 0.00 347/56861 concat [111]
0.00 0.00 3066268/3066270 xfont_get_cache [605]
0.00 0.00 347/5788 Fvconcat [739]
-----------------------------------------------
The difference there is this line in the slow profile:
0.04 0.91 554734/554734 xfont_list [17]
(compare to this line:)
0.00 0.00 461/461 xfont_list [245]
font_list_entities is in src/font.c; it call xfont_list here (old code):
Lisp_Object copy;
val = driver_list->driver->list (f, scratch_font_spec); // ← HERE
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)));
Here is the new code:
val = driver_list->driver->list (f, scratch_font_spec);
if (!NILP (val))
{
Lisp_Object copy = copy_font_spec (scratch_font_spec);
val = Fvconcat (1, &val);
ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
}
The commit message didn't explain why it was a good thing to not add an empty vector to the cache.
I'm a bit stuck at this point. I'm not sure how 1 and 2 are connected. Suggestions?
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-03-03 7:33 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 10:34 bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014) Clément Pit--Claudel
2015-07-10 12:30 ` Eli Zaretskii
2015-07-10 16:02 ` Clément Pit--Claudel
2015-07-10 12:41 ` Eli Zaretskii
2015-07-10 16:55 ` Clément Pit--Claudel
2015-07-15 12:32 ` Dmitry Antipov
2015-07-18 10:24 ` Clément Pit--Claudel
2015-07-18 11:16 ` Clément Pit--Claudel
2015-07-18 11:26 ` Eli Zaretskii
2015-07-18 20:08 ` Clément Pit--Claudel
2016-03-03 6:12 ` Clément Pit--Claudel
2016-03-03 6:42 ` Clément Pit--Claudel
2016-03-03 7:08 ` Clément Pit--Claudel
2016-03-03 7:33 ` Clément Pit--Claudel [this message]
2016-03-03 17:10 ` Glenn Morris
2016-03-03 17:28 ` Clément Pit--Claudel
2016-03-03 20:27 ` Eli Zaretskii
2016-07-20 21:26 ` Clément Pit--Claudel
2016-07-21 14:21 ` Eli Zaretskii
2016-07-21 14:33 ` Clément Pit--Claudel
2016-07-23 20:50 ` Clément Pit--Claudel
2016-10-04 22:17 ` Clément Pit--Claudel
2016-10-26 17:15 ` Clément Pit--Claudel
2016-10-27 14:38 ` Eli Zaretskii
2016-10-27 15:29 ` Clément Pit--Claudel
2016-10-27 15:55 ` Eli Zaretskii
2016-10-28 14:23 ` Clément Pit--Claudel
2016-10-28 14:33 ` Eli Zaretskii
2016-11-18 8:55 ` Eli Zaretskii
2016-12-18 17:33 ` Clément Pit--Claudel
2016-12-18 17:37 ` Eli Zaretskii
2016-12-18 18:04 ` Clément Pit--Claudel
2016-12-18 19:52 ` Eli Zaretskii
2016-12-18 20:44 ` Clément Pit--Claudel
2016-12-19 15:50 ` Eli Zaretskii
2016-12-19 16:25 ` Clément Pit--Claudel
2016-12-19 16:39 ` Eli Zaretskii
2016-12-19 16:55 ` Clément Pit--Claudel
2016-12-19 16:58 ` Eli Zaretskii
2016-12-19 17:13 ` Clément Pit--Claudel
2016-12-22 16:25 ` Eli Zaretskii
2016-12-22 16:49 ` Clément Pit--Claudel
2016-12-22 18:04 ` Eli Zaretskii
2016-12-22 19:08 ` Clément Pit--Claudel
2017-02-10 4:45 ` Clément Pit--Claudel
2017-03-12 11:38 ` Clément Pit--Claudel
2017-03-12 15:49 ` Eli Zaretskii
2017-03-12 17:24 ` Clément Pit--Claudel
2017-03-12 17:48 ` Eli Zaretskii
2017-03-12 19:19 ` Clément Pit--Claudel
2017-03-13 15:46 ` Eli Zaretskii
2017-03-13 16:36 ` Clément Pit--Claudel
2017-03-13 17:22 ` Eli Zaretskii
2017-03-13 19:04 ` Clément Pit--Claudel
2017-03-13 20:53 ` Eli Zaretskii
2017-03-14 19:45 ` Clément Pit--Claudel
2017-03-15 15:37 ` Eli Zaretskii
2017-03-14 15:45 ` Eli Zaretskii
2017-03-14 19:35 ` Clément Pit--Claudel
2017-03-15 15:36 ` Eli Zaretskii
2017-03-15 20:46 ` Clément Pit--Claudel
2017-03-16 15:27 ` Eli Zaretskii
2017-03-16 21:23 ` Clément Pit--Claudel
2017-03-17 8:15 ` Eli Zaretskii
2017-04-16 7:48 ` Eli Zaretskii
2017-04-16 15:28 ` Clément Pit--Claudel
2016-12-19 17:00 ` Clément Pit--Claudel
2015-07-10 15:42 ` Glenn Morris
2016-03-03 6:37 ` Clément Pit--Claudel
2016-10-04 18:56 ` Jason Gross
2017-03-13 15:54 ` bug#21028: Slow font rendering in emacs Ralf Jung
2017-03-13 17:05 ` Eli Zaretskii
2017-03-13 18:12 ` Ralf Jung
2017-03-13 20:39 ` Eli Zaretskii
2017-03-14 15:57 ` Ralf Jung
2017-03-14 17:11 ` Eli Zaretskii
2017-03-14 18:50 ` Ralf Jung
2017-03-14 19:16 ` Eli Zaretskii
2017-03-14 19:17 ` Ralf Jung
2017-03-14 20:49 ` John Mastro
2017-03-15 15:40 ` Eli Zaretskii
2017-03-14 15:47 ` Eli Zaretskii
2017-03-14 18:41 ` Ralf Jung
2017-03-14 19:16 ` Eli Zaretskii
2017-03-14 19:39 ` Ralf Jung
2017-03-14 19:45 ` Ralf Jung
2017-03-15 15:36 ` Eli Zaretskii
2017-04-22 8:54 ` Ralf Jung
2017-04-22 13:40 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D7E8D6.6080508@live.com \
--to=clement.pitclaudel@live.com \
--cc=21028@debbugs.gnu.org \
--cc=dmantipov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).