unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: geza.herman@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: Rendering performace vs. line-spacing
Date: Fri, 08 Jan 2021 14:22:50 +0200	[thread overview]
Message-ID: <83a6tjk485.fsf@gnu.org> (raw)
In-Reply-To: <5f7dd7c3-ec7d-ffd5-76af-1a5ee5177d07@gmail.com> (message from Herman, Géza on Fri, 8 Jan 2021 12:34:53 +0100)

> From: Herman, Géza <geza.herman@gmail.com>
> Date: Fri, 8 Jan 2021 12:34:53 +0100
> 
> I noticed that emacs's performance can depend on the font. For example, 
> Consolas has a much worse performance (scrolling is sluggish) than 
> BitStream Mono. I profiled emacs, and the main difference is 
> "draw_glyphs". When emacs is slow (using consolas), this function takes 
> 50-60% of CPU time (measured by "perf record -g"). When emacs is fast 
> (using BitStream), this function takes only ~2-3%.
> 
> I played with my font's ascent and descent settings to have more line on 
> the screen (as emacs doesn't support negative line-spacing). Originally, 
> "draw_glyphs" takes 2-3% with my font. But if I decrease the height of 
> the font by modifying ascent/descent, then the same thing happens: 
> draw_glyphs takes 50-60% CPU time. If I set line-spacing to 2, 
> draw_glyphs become normal, 2-3% CPU time.
> 
> (I'm using a master build from yesterday)
> 
> Any ideas why this happens? Maybe this happens because lines may overlap 
> and some caching mechanism gets disabled?

When screen lines can overlap, we have code to handle that, and it
indeed could slow down redisplay.  However, you are saying that you
_decrease_ ascent/descent, and I'm not sure I understand how could
that cause overlaps?

In any case, I suggest to profile the code with perf, and see which
parts of the display code (below draw_glyphs) take those cycles with
the problematic font(s).  Then we will see which part is the culprit,
and could take it from there.



  reply	other threads:[~2021-01-08 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 11:34 Rendering performace vs. line-spacing Herman, Géza
2021-01-08 12:22 ` Eli Zaretskii [this message]
2021-01-08 13:46   ` Herman, Geza
2021-01-08 14:35     ` Eli Zaretskii
2021-01-08 15:38       ` Herman, Geza
2021-01-08 15:46         ` Eli Zaretskii
2021-01-08 16:04           ` Herman, Geza

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=83a6tjk485.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=geza.herman@gmail.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).