emacs-devel
[Top][All Lists]
Advanced

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

Re: Rendering performace vs. line-spacing


From: Eli Zaretskii
Subject: Re: Rendering performace vs. line-spacing
Date: Fri, 08 Jan 2021 14:22:50 +0200

> 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 via email to

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