From: Eli Zaretskii <eliz@gnu.org>
To: "John Coughlin" <jack@johnbcoughlin.com>
Cc: emacs-devel@gnu.org
Subject: Re: Iteration over frame->face_alist is a huge performance suck
Date: Fri, 02 Jul 2021 09:20:54 +0300 [thread overview]
Message-ID: <83o8bljkxl.fsf@gnu.org> (raw)
In-Reply-To: <3be10451-2126-4f55-b460-6d8191535c30@www.fastmail.com> (jack@johnbcoughlin.com)
> Date: Thu, 01 Jul 2021 20:58:07 -0700
> From: "John Coughlin" <jack@johnbcoughlin.com>
>
> Recently I have been investigating slowdowns in overall responsiveness
> and snappiness in my emacs setup, which arise during the course of
> normal work. I attached a sampling profiler to the process
> (Instruments on MacOS), and recorded ten or so seconds of
> mashing the movement cursors in my org-agenda window. The result is
> that 93.4% of the total samples are inside of the function
> lface_from_face_name_no_resolve, in xfaces.c. The culprit seems to be
> a large association list, frame->face_list, which in my current
> session contains over 1000 faces.
This is a known problem. The current implementation of face lookup
doesn't scale well enough to such usage patterns.
> - This may be less of a problem in vanilla emacs, but some packages create faces
> that result in quite deep recursive calls to merge_named_face. Each such frame
> in the stack (I observed upwards of 50 such frames with my org-agenda button
> mashing) is doing its own face lookups.
Yes, and watch out for faces that inherit from other faces, which
themselves inherit from other faces.
> So, what should be done about this?
We have a solution designed and almost implemented: see bug#41200.
Unfortunately, its development stalled. It would be good to finalize
the code, resolve the issues that were found with it (as discussed in
the bug thread), and install it.
next prev parent reply other threads:[~2021-07-02 6:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 3:58 Iteration over frame->face_alist is a huge performance suck John Coughlin
2021-07-02 6:20 ` Eli Zaretskii [this message]
2021-07-02 13:39 ` John Coughlin
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=83o8bljkxl.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jack@johnbcoughlin.com \
/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).