Subject: Re: bug#28695: 26.0.60; Rendering lag spikes caused by double-buffering on Linux

From: Dmitry Gutov <[email-masked]>
Date: Mon, 16 Oct 2017 01:55:54 +0300

On 10/9/17 5:03 PM, Eli Zaretskii wrote:

> I think this page (which you probably already know about) is a good
> starting point:
> 
>    http://www.brendangregg.com/perf.html

I still haven't found the appropriate recipe there, but somebody else on 
the internet suggested this, effectively:

sudo perf record -g src/emacs
# produces perf.data
sudo perf report -g -i perf.data

> Well, you saw a difference between a 4K display and a 2K display,
> didn't you?  All we need is to compare 2 situations and see where's
> the extra time spent.

A certain difference, but not a stark one. Like, I couldn't produce a 
full-on stuttering even with 4K (sometimes the gears continue spinning 
fine; probably has something to do with thread or process scheduling). 
With a small-window Emacs, the gears are spinning mostly fine.

Here are the window configurations:

1. Emacs fullscreen, 4K.
2. Emacs in a small window, much less than 2K.

Unfortunately, and if I'm reading the report right, XdbeSwapBuffers 
takes only 0,03% of CPU time in the first case and 0,02% in the second 
case. So, less than 1 percent in both cases.

Here's how it looks. I search for the function name in the report 
program, and it shows something like this:

   Children  Self   Comma  Shared Object     Symbol
   0,03%     0,03%  emacs  libXext.so.6.4.0  [.] XdbeSwapBuffers
   0,00%     0,00%  emacs  emacs             [.] XdbeSwapBuffers@plt

I'm not quite sure if perf.data contains sensitive information, but I'd 
be happy to send you the files produced by both scenarios for further 
analysis. Questions welcome, too.