Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backends: xrender less laggy than glx? #620

Open
ro-i opened this issue Apr 20, 2021 · 12 comments
Open

backends: xrender less laggy than glx? #620

ro-i opened this issue Apr 20, 2021 · 12 comments
Labels
performance Issue related to performance

Comments

@ro-i
Copy link

ro-i commented Apr 20, 2021

Hi! :) This is not really a bug report, but rather a question out of curiosity.
I wonder why with my current configuration and setup, the xrender backend is less laggy than the glx backend. Both prevent tearing, but when I move a floating window around, it lags much more with the glx backend than with the xrender backend.
Note: I am referring to the "experimental" backends!
I would be really interested to learn why this could be the case or if I did something wrong in my config. I'm a long-term user of compton/picom, but most of the time I used the intel Xorg driver with the TearFree option and disabled vsync in the compositor. But since a few months, I finally switched to the modesetting driver because there has been a bug in the intel driver that affected me (and because the modesetting driver is said to be more performant anyway).

Platform

Fedora 34 (pre-release), kernel 5.11.14-300.fc34.x86_64

GPU, drivers, and screen setup

Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620], modesetting driver for Xorg, external 1920x1080 monitor connected to laptop via DisplayPort (over USB-C).
vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.4.1
glxinfo -B:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) UHD Graphics 620 (WHL GT2) (0x3ea0)
    Version: 21.0.2
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (WHL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.0.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.0.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.0.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

i3 :)

picom version

picom --diagnostics:

**Version:** v8.2

### Extensions:

* Shape: Yes
* XRandR: Yes
* Present: Present

### Misc:

* Use Overlay: No (Another compositor is already running)
* Config file used: /home/ro/.config/picom.conf

### Drivers (inaccurate):

modesetting  

Configuration:

grep '^[^#]' .config/picom.conf:

shadow = false;
fading = false
backend = "xrender";
vsync = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
detect-transient = true;
detect-client-leader = true;
glx-no-stencil = true
glx-no-rebind-pixmap = true
use-damage = true;
log-level = "warn";

Thank you very much! ❤️

@ro-i ro-i changed the title backends: Xrender less laggy than glx? backends: xrender less laggy than glx? Apr 20, 2021
@yshui yshui added the performance Issue related to performance label Jun 4, 2021
@MahouShoujoMivutilde
Copy link

I am on nvidia (proprietary driver) and also noticed that glx tends to be more laggy, but in other way - gpu accelerated terminals (alacritty, kitty) take ~1.5x more time to start compared to xrender:

Tests

With picom --experimental-backends --backend=glx --no-vsync --config=/dev/null

~ took 3s ❯ hyperfine 'alacritty -e false'
Benchmark #1: alacritty -e false
  Time (mean ± σ):     188.1 ms ±  11.5 ms    [User: 98.6 ms, System: 46.6 ms]
  Range (min … max):   171.0 ms … 213.9 ms    15 runs

Alacritty takes about ~190ms to launch.

Same with legacy backend: picom --backend=glx --no-vsync --config=/dev/null

~ took 3s ❯ hyperfine 'alacritty -e false'
Benchmark #1: alacritty -e false
  Time (mean ± σ):     184.4 ms ±  21.1 ms    [User: 94.0 ms, System: 43.2 ms]
  Range (min … max):   145.4 ms … 214.4 ms    17 runs


Now with xrender:

Experimental: picom --experimental-backends --backend=xrender --no-vsync --config=/dev/null

~ ❯ hyperfine 'alacritty -e false'
Benchmark #1: alacritty -e false
  Time (mean ± σ):     124.1 ms ±  10.8 ms    [User: 84.2 ms, System: 37.2 ms]
  Range (min … max):   114.0 ms … 148.6 ms    19 runs

Legacy: picom --backend=xrender --no-vsync --config=/dev/null

~ took 2s ❯ hyperfine 'alacritty -e false'
Benchmark #1: alacritty -e false
  Time (mean ± σ):     126.2 ms ±   7.9 ms    [User: 87.9 ms, System: 38.4 ms]
  Range (min … max):   114.2 ms … 143.4 ms    23 runs

Notice how it takes only ~125ms on average now.

Hyperfine.

@yshui
Copy link
Owner

yshui commented Jun 20, 2021

Probably related: #641

@kwand
Copy link

kwand commented Jun 25, 2021

Probably related: #641

This, specifically there have been changes since v8.2 that affect floating window performance. (I noticed this very clearly while doing my testing).

@ro-i If you try the current git branch (next), I think you will observe much less floating window lag.

@MahouShoujoMivutilde Which version of picom are you using? The release version (8.2) or the current branch? Also, since you're on NVIDIA, I think you'll benefit from both the current branch and flag testing I'm doing.

@MahouShoujoMivutilde
Copy link

@kwand i am on latest next, yes.

Driver version 460.56, from nvidia-all, kernel is linux-tkg 5.10.y lts with muqss and not much else (i found this combination of versions avoids random freezes (which "been fixed", but in reality just became harder to trigger, but still happen sometimes on latest drivers)).

Also my gpu is quite old - gtx 970.

So i tried your patch, but sadly it seems there is no significant difference.

Tests

no #641, e09679c:

~ ❯ ./test.sh
glx
Benchmark #1: alacritty -e false
  Time (mean ± σ):     183.6 ms ±  12.6 ms    [User: 89.3 ms, System: 40.0 ms]
  Range (min … max):   166.8 ms … 221.7 ms    17 runs

xrender
Benchmark #1: alacritty -e false
  Time (mean ± σ):     121.4 ms ±   9.7 ms    [User: 81.3 ms, System: 35.1 ms]
  Range (min … max):   113.7 ms … 147.4 ms    22 runs

e09679c with #641:


~ took 2s ❯ ./test.sh
glx
Benchmark #1: alacritty -e false
  Time (mean ± σ):     181.2 ms ±  14.2 ms    [User: 86.1 ms, System: 37.8 ms]
  Range (min … max):   162.5 ms … 203.6 ms    16 runs

xrender
Benchmark #1: alacritty -e false
  Time (mean ± σ):     121.5 ms ±   9.0 ms    [User: 84.0 ms, System: 39.4 ms]
  Range (min … max):   113.0 ms … 146.2 ms    23 runs

test.sh

#!/usr/bin/env sh

pid=/tmp/picom.pid

run() {
    echo "$1"
    picom -b --write-pid-path="$pid" --experimental-backends --no-vsync --backend="$1" --config=/dev/null
    sleep 0.5s
    hyperfine 'alacritty -e false'
    kill $(cat $pid)
    sleep 0.5s
}

run glx

run xrender

(I made sure patch applied, tests are on new picom, etc)

Also, you guys been talking about triple buffering, so i think it's may be worth noting that i have it enabled in xorg config:

/etc/X11/xorg.conf.d/20-nvidia.conf

Section "Screen"
    Identifier     "Screen0"

    # for vsync without compositor
    Option         "metamodes" "nvidia-auto-select +0+0 { ForceCompositionPipeline=On, ForceFullCompositionPipeline = On }"
    Option         "TripleBuffer" "On"
    Option         "AllowIndirectGLXProtocol" "Off"

    # Option         "ConnectToAcpid" "Off"

EndSection

@kwand
Copy link

kwand commented Jun 26, 2021

Also, you guys been talking about triple buffering, so i think it's may be worth noting that i have it enabled in xorg config:

I've been talking about disabling triple buffering. The fact that you have it enabled is might conflict with the patch, which tries to turn it off for picom.

There's no real reason to have triple buffering enabled for a compositor, unless you want to prioritize smoothness at the cost of responsiveness.

Though, I will note the difference with my patch is only slight. There is another method that I tried (it's mentioned in the first post of the PR), which may or may not benefit you, but I've abandoned it now since it introduces a bunch of old glitches and will require a major rewrite of the code, for just 5-10ms less latency. Don't get me wrong that this amount of latency reduction is still significant - it's just that the rewrite is many times more significant that I can't really justify it (at least for my implementation)

Also, I don't really believe your GPU is old enough to be the problem here. I think it's likely it is not even boosting while rendering picom, which should make it perform almost on par with newer GPUs.

@kwand
Copy link

kwand commented Jun 26, 2021

Option         "metamodes" "nvidia-auto-select +0+0 { ForceCompositionPipeline=On, ForceFullCompositionPipeline = On }"

Also, I just noticed that you have this line in your xorg config. Is this turned on? (i.e. ForceCompositionPipeline and ForceFullCompositionPipeline? I don't really understand the syntax of this config file unfortunately)

If it is, I would turn it off while testing - I've noticed increased lag when it's on and it's a bit superfluous as picom is already trying to do the same thing. The comment you have above seems to say the same thing: "for vsync without compositor"

I still can't quite explain why glX takes 1.5x longer though - even in theory. My best guess (without evidence) is that glX may be more graphically demanding than xrender? If that is the case, I would try re-performing the test with "Prefer Maximum Performance" enabled, as shown here:

image

This should force the GPU to run at its maximum boost clock.

@MahouShoujoMivutilde
Copy link

MahouShoujoMivutilde commented Jun 26, 2021

unless you want to prioritize smoothness at the cost of responsiveness.

Actually, it seems that triple buffering gives me significantly better latency.

No triple buffering, ForceCompositionPipeline=On:

glx
Benchmark #1: alacritty -e false
  Time (mean ± σ):     216.5 ms ±  12.8 ms    [User: 101.4 ms, System: 46.3 ms]
  Range (min … max):   197.7 ms … 231.3 ms    13 runs

xrender
Benchmark #1: alacritty -e false
  Time (mean ± σ):     166.6 ms ±   7.9 ms    [User: 107.7 ms, System: 44.8 ms]
  Range (min … max):   147.7 ms … 181.4 ms    17 runs

No triple buffering and no ForceCompositionPipeline=On

~ took 25s ❯ ./test.sh
glx
Benchmark #1: alacritty -e false
  Time (mean ± σ):     228.1 ms ±  20.0 ms    [User: 129.5 ms, System: 64.3 ms]
  Range (min … max):   181.5 ms … 260.4 ms    13 runs

xrender
Benchmark #1: alacritty -e false
  Time (mean ± σ):     164.8 ms ±   7.3 ms    [User: 100.9 ms, System: 43.2 ms]
  Range (min … max):   147.5 ms … 180.7 ms    19 runs

No ForceCompositionPipeline=on but triple buffering is on

glx
Benchmark #1: alacritty -e false
  Time (mean ± σ):     180.1 ms ±  15.1 ms    [User: 103.0 ms, System: 48.3 ms]
  Range (min … max):   152.8 ms … 200.6 ms    18 runs

xrender
Benchmark #1: alacritty -e false
  Time (mean ± σ):     121.3 ms ±  10.4 ms    [User: 85.3 ms, System: 37.7 ms]
  Range (min … max):   112.4 ms … 148.2 ms    23 runs

* when i write "no something", what i mean is that i just commenting this thing out from config above. Should not make any difference, according to defaults.

Though, I will note the difference with my patch is only slight

Doesn't hurt to try it anyway. And thank you for trying to come up with improvements 👍

it's just that the rewrite is many times more significant that I can't really justify it

Yeah, makes sense.


Also, I just noticed that you have this line in your xorg config. Is this turned on?

Yes, but it doesn't actually add any significant latency (see above), in fact - the biggest increase in latency regarding xorg config was from disabling TripleBuffer.

comment you have above seems to say the same thing: "for vsync without compositor"

I wrote that myself, and that's why all my tests are with --no-vsync ;)

Theoretically, having vsync on driver level should give less latency compared to picom --vsync, but that i haven't tested yet.

However, at the moment, fastest runs were with ForceCompositionPipeline=On.

I would try re-performing the test with "Prefer Maximum Performance" enabled, as shown here

I just tried that, and results are the same. P state switches to 4 even with default setting fast enough to not matter.

@kwand
Copy link

kwand commented Jun 27, 2021

I wrote that myself, and that's why all my tests are with --no-vsync ;)

Well, this was a complete oversight of mine. I didn't notice that at all! I can see why my patch probably has no effect then since I believe it would only work if vsync is enabled.

Thank you for doing the testing - I'm currently unable to do much due to time constraints. They're all quite interesting, and unfortunately, I have no idea how to explain the results.

(Actually, it's possible I was mistaken about enabling triple buffering in the xorg conf forces picom to use triple buffering as well. To reiterate, this does not really matter in your case since you disabled vsync, but it's possible you're seeing gains b/c of enabling/disabling triple buffering for alacritty.)

Theoretically, having vsync on driver level should give less latency compared to picom --vsync, but that i haven't tested yet.

Would love to see the results for this as well, whenever you have the time, since my PR mainly improves vsync inside picom.

@MahouShoujoMivutilde
Copy link

MahouShoujoMivutilde commented Jun 28, 2021

@kwand Okay, i tested whole bunch of things.

Buckle up

"Sync to vblank" and "allow flipping" are from nvidia OpenGL settings. I found
by accident that they both were enabled, and after playing around with them it
turned out they influence glx latency quite significantly, so i decided to
include them as well.

ffcp is ForceCompositionPipeline stuff from Xorg config above, nvidia's driver level vsync.

Patched means #641 applied.

Each row is 100 counted runs + 3 warm up runs.

backend picom vsync sync to vblank allow flipping triple buffer ffcp patched mean median stddev
xrender True True False True False True 113 114 3.56
xrender True False True True False True 113 114 3.46
xrender False True True True False True 113 114 3.41
xrender True False False True False True 113 114 3.77
xrender True True False True True True 114 113 2.93
xrender True False False True True True 114 114 2.62
xrender False True False True False True 114 114 3.34
xrender False False False True False True 114 114 3.6
glx False False False True False True 114 114 2.88
xrender False False True True False True 114 114 5
xrender True True True True False True 114 114 2.94
xrender True True False True False False 114 114 3.17
xrender True False False True False False 114 114 3.26
xrender True True True True False False 114 114 3.4
xrender False True False True True False 114 114 3.28
xrender True False False True True False 114 114 2.4
xrender False False True True True False 114 114 3.14
xrender False True False True True True 115 114 3.71
xrender True False True True True True 115 114 3.23
xrender False False False True True True 115 114 3.54
xrender False True True True True True 115 114 3.28
xrender False False True True True True 115 114 4.08
xrender True True True True True True 115 114 2.99
glx False True False True False True 115 114 4.35
xrender True False True True False False 115 114 3.17
xrender False False False True False False 115 114 2.9
xrender False True True True False False 115 114 3.42
xrender False False True True False False 115 114 3.43
xrender True True False True True False 115 114 2.82
xrender True False True True True False 115 114 3.53
xrender False False False True True False 115 114 3.14
xrender False True True True True False 115 114 3.39
glx False False False True True False 115 115 3.88
xrender True True True True True False 115 114 2.99
glx False False False True True True 116 115 3.83
xrender False True False True False False 116 114 3.63
glx False False False True False False 116 114 4.21
glx False True False True True True 117 115 5.02
glx False True False True False False 118 116 4.97
glx False True False True True False 118 115 5.13
glx True False False True False True 137 137 10.22
glx True True False True False True 138 134 10.57
glx True True False True True False 142 146 9.62
glx True False False True True False 142 147 9.51
glx True True False True True True 144 147 8.18
glx True False False True True True 144 147 8.42
xrender True True False False True True 147 148 9.89
xrender True True True False True True 147 148 8.99
xrender True True False False True False 148 148 10.72
xrender True True True False True False 149 148 9.88
glx True True False True False False 149 148 9.46
glx True False False True False False 149 148 9.92
glx False True False False True False 150 148 11.08
xrender True False True False True True 150 148 9.64
xrender True False False False True True 150 148 9.62
glx False False False False True True 150 148 10.61
xrender True True False False False True 150 148 9.51
glx False True False False True True 151 148 10.77
xrender False True False False True True 151 148 9.63
xrender False True True False True True 151 148 10.3
xrender True False False False True False 152 148 10.12
glx False False False False True False 152 148 9.54
xrender False False False False True True 152 148 10.22
xrender True True True False False False 152 148 8.93
xrender False True False False True False 153 148 9.55
xrender False True True False True False 153 148 9.68
xrender True False False False False False 153 148 8.19
xrender True False False False False True 153 148 9.62
xrender True True True False False True 153 148 9.51
xrender True False True False True False 154 148 10.67
xrender False False True False True True 154 148 9.42
glx False True False False False False 154 148 8.89
glx False True False False False True 154 148 10.25
xrender True False True False False True 154 148 10.16
xrender False False False False True False 155 148 9.48
xrender False False True False True False 156 163 8.89
xrender True True False False False False 156 156 9.73
xrender True False True False False False 156 151 8.25
xrender False True True False False False 156 162 8.97
glx False False False False False False 156 149 8.47
glx False False False False False True 156 163 9.56
xrender False False True False False True 156 164 9.01
xrender False True False False False False 157 164 8.74
xrender False True False False False True 157 164 8.67
xrender False False False False False True 157 164 8.57
xrender False True True False False True 157 164 8.63
glx True True False False True True 158 164 8.63
glx True False False False True True 158 164 9.89
xrender False False False False False False 158 164 8.25
xrender False False True False False False 158 164 8.26
glx True True False False False True 158 164 8.26
glx False False True True True True 159 164 9.93
glx True True False False True False 159 164 11.03
glx True False False False False True 159 164 10.28
glx True False False False True False 161 164 14.34
glx True True False False False False 161 164 13.07
glx False False True True True False 162 164 10.37
glx True False False False False False 164 164 15.33
glx True True True True True False 168 165 6.59
glx True False True True True True 169 166 6.1
glx True True True True True True 169 166 8.23
glx False True True True False True 169 170 16.2
glx False False True True False True 169 166 8.9
glx False True True True True False 169 165 7.09
glx False False True True False False 170 168 10.32
glx True False True True True False 170 165 8.91
glx False True True True True True 172 168 10.47
glx False True True True False False 175 177 10.42
glx True False True True False True 200 198 5.73
glx False False True False True False 203 198 10.89
glx False False True False False False 205 198 11.78
glx False True True False True False 206 198 14.83
glx True True True True False True 207 213 9.38
glx True False True True False False 209 213 7.82
glx True True True True False False 209 213 7.88
glx False True True False False False 210 214 14.74
glx False True True False True True 211 213 13.85
glx False False True False True True 212 206 16.12
glx False False True False False True 213 214 12.3
glx False True True False False True 215 214 16.15
glx True False True False True False 234 231 14.11
glx True True True False True False 236 232 12.62
glx True False True False True True 236 232 14.75
glx True True True False True True 238 232 14.03
glx True True True False False False 283 281 21.35
glx True False True False False False 284 289 19.28
glx True True True False False True 284 281 22.15
glx True False True False False True 288 290 20.69

For reference, this is how latency looks without picom running

~ ❯ hyperfine -r 100 -w 3 'alacritty --class floatme,floatme -e false'
Benchmark #1: alacritty --class floatme,floatme -e false
  Time (mean ± σ):     114.4 ms ±   2.8 ms    [User: 89.8 ms, System: 39.3 ms]
  Range (min … max):   108.4 ms … 123.5 ms    100 runs

Same table in json
  [
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 113,
      "median": 114,
      "stddev": 3.56
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 113,
      "median": 114,
      "stddev": 3.46
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 113,
      "median": 114,
      "stddev": 3.41
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 113,
      "median": 114,
      "stddev": 3.77
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 114,
      "median": 113,
      "stddev": 2.93
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 2.62
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 3.34
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 3.6
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 2.88
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 5.0
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 114,
      "median": 114,
      "stddev": 2.94
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 3.17
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 3.26
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 3.4
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 3.28
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 2.4
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 114,
      "median": 114,
      "stddev": 3.14
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 3.71
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 3.23
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 3.54
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 3.28
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 4.08
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 2.99
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 115,
      "median": 114,
      "stddev": 4.35
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.17
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 2.9
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.42
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.43
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 2.82
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.53
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.14
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 3.39
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 115,
      "stddev": 3.88
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 115,
      "median": 114,
      "stddev": 2.99
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 116,
      "median": 115,
      "stddev": 3.83
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 116,
      "median": 114,
      "stddev": 3.63
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 116,
      "median": 114,
      "stddev": 4.21
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 117,
      "median": 115,
      "stddev": 5.02
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 118,
      "median": 116,
      "stddev": 4.97
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 118,
      "median": 115,
      "stddev": 5.13
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 137,
      "median": 137,
      "stddev": 10.22
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 138,
      "median": 134,
      "stddev": 10.57
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 142,
      "median": 146,
      "stddev": 9.62
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 142,
      "median": 147,
      "stddev": 9.51
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 144,
      "median": 147,
      "stddev": 8.18
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 144,
      "median": 147,
      "stddev": 8.42
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 147,
      "median": 148,
      "stddev": 9.89
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 147,
      "median": 148,
      "stddev": 8.99
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 148,
      "median": 148,
      "stddev": 10.72
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 149,
      "median": 148,
      "stddev": 9.88
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 149,
      "median": 148,
      "stddev": 9.46
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 149,
      "median": 148,
      "stddev": 9.92
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 150,
      "median": 148,
      "stddev": 11.08
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 150,
      "median": 148,
      "stddev": 9.64
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 150,
      "median": 148,
      "stddev": 9.62
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 150,
      "median": 148,
      "stddev": 10.61
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 150,
      "median": 148,
      "stddev": 9.51
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 151,
      "median": 148,
      "stddev": 10.77
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 151,
      "median": 148,
      "stddev": 9.63
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 151,
      "median": 148,
      "stddev": 10.3
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 152,
      "median": 148,
      "stddev": 10.12
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 152,
      "median": 148,
      "stddev": 9.54
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 152,
      "median": 148,
      "stddev": 10.22
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 152,
      "median": 148,
      "stddev": 8.93
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 153,
      "median": 148,
      "stddev": 9.55
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 153,
      "median": 148,
      "stddev": 9.68
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 153,
      "median": 148,
      "stddev": 8.19
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 153,
      "median": 148,
      "stddev": 9.62
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 153,
      "median": 148,
      "stddev": 9.51
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 154,
      "median": 148,
      "stddev": 10.67
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 154,
      "median": 148,
      "stddev": 9.42
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 154,
      "median": 148,
      "stddev": 8.89
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 154,
      "median": 148,
      "stddev": 10.25
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 154,
      "median": 148,
      "stddev": 10.16
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 155,
      "median": 148,
      "stddev": 9.48
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 156,
      "median": 163,
      "stddev": 8.89
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 156,
      "median": 156,
      "stddev": 9.73
    },
    {
      "backend": "xrender",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 156,
      "median": 151,
      "stddev": 8.25
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 156,
      "median": 162,
      "stddev": 8.97
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 156,
      "median": 149,
      "stddev": 8.47
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 156,
      "median": 163,
      "stddev": 9.56
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 156,
      "median": 164,
      "stddev": 9.01
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 157,
      "median": 164,
      "stddev": 8.74
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 157,
      "median": 164,
      "stddev": 8.67
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 157,
      "median": 164,
      "stddev": 8.57
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 157,
      "median": 164,
      "stddev": 8.63
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 158,
      "median": 164,
      "stddev": 8.63
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 158,
      "median": 164,
      "stddev": 9.89
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 158,
      "median": 164,
      "stddev": 8.25
    },
    {
      "backend": "xrender",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 158,
      "median": 164,
      "stddev": 8.26
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 158,
      "median": 164,
      "stddev": 8.26
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 159,
      "median": 164,
      "stddev": 9.93
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 159,
      "median": 164,
      "stddev": 11.03
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 159,
      "median": 164,
      "stddev": 10.28
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 161,
      "median": 164,
      "stddev": 14.34
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 161,
      "median": 164,
      "stddev": 13.07
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 162,
      "median": 164,
      "stddev": 10.37
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": false,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 164,
      "median": 164,
      "stddev": 15.33
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 168,
      "median": 165,
      "stddev": 6.59
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 169,
      "median": 166,
      "stddev": 6.1
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 169,
      "median": 166,
      "stddev": 8.23
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 169,
      "median": 170,
      "stddev": 16.2
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 169,
      "median": 166,
      "stddev": 8.9
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 169,
      "median": 165,
      "stddev": 7.09
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 170,
      "median": 168,
      "stddev": 10.32
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": false,
      "mean": 170,
      "median": 165,
      "stddev": 8.91
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": true,
      "patched": true,
      "mean": 172,
      "median": 168,
      "stddev": 10.47
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 175,
      "median": 177,
      "stddev": 10.42
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 200,
      "median": 198,
      "stddev": 5.73
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 203,
      "median": 198,
      "stddev": 10.89
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 205,
      "median": 198,
      "stddev": 11.78
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 206,
      "median": 198,
      "stddev": 14.83
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": true,
      "mean": 207,
      "median": 213,
      "stddev": 9.38
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 209,
      "median": 213,
      "stddev": 7.82
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": true,
      "ffcp": false,
      "patched": false,
      "mean": 209,
      "median": 213,
      "stddev": 7.88
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 210,
      "median": 214,
      "stddev": 14.74
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 211,
      "median": 213,
      "stddev": 13.85
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 212,
      "median": 206,
      "stddev": 16.12
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 213,
      "median": 214,
      "stddev": 12.3
    },
    {
      "backend": "glx",
      "picom_vsync": false,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 215,
      "median": 214,
      "stddev": 16.15
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 234,
      "median": 231,
      "stddev": 14.11
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": false,
      "mean": 236,
      "median": 232,
      "stddev": 12.62
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 236,
      "median": 232,
      "stddev": 14.75
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": true,
      "patched": true,
      "mean": 238,
      "median": 232,
      "stddev": 14.03
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 283,
      "median": 281,
      "stddev": 21.35
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": false,
      "mean": 284,
      "median": 289,
      "stddev": 19.28
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": true,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 284,
      "median": 281,
      "stddev": 22.15
    },
    {
      "backend": "glx",
      "picom_vsync": true,
      "sync_to_vblank": false,
      "allow_flipping": true,
      "triple_buffer": false,
      "ffcp": false,
      "patched": true,
      "mean": 288,
      "median": 290,
      "stddev": 20.69
    }
  ]

So what i noticed:

  1. You can make glx (--no-vsync) as fast as xrender while keeping ffcp and
    triple buffering. Nice!
  2. Xrender --vsync doesn't actually work (there is still tearing), and
    latency says the same.
  3. ffcp (115ms) is indeed faster than picom glx --vsync (137ms) .
  4. Allow flipping generally slows glx down (40-60ms difference for both picom
    --vsync and ffcp).
  5. Sync to vblank does not seem to matter a lot.
  6. Your patch is indeed helps for glx --vsync (patched vs unpatched is about
    10ms difference!), xrender and ffcp don't care.
  7. Triple buffering generally improves latency.

Note: If you use a tiling window manager, it is important to launch alacritty
as floating window to minimize margin of error.

Methodology To at least partially automate testing i wrote a new script
test2.sh

It assumes running in tmux (to collect hyperfine's output as it was on screen),
but it's not strictly necessary.

It runs picom/nvidia with different options and tests them on alacritty via
hyperfine (which also saves json for each run).

It can't, however, change Xorg options (ffcp, triple buffering), so that is
expected to be done by hand, since they will require Xorg restart.

It also doesn't install patched/unpatched picom for you.

First argument is expected to be a name for results folder of particular Xorg options
(name should be (no-3b|3b),(no-ffcp|ffcp),(641|def) for sort-times.py
below).

This folder will be created under ~/picom. Terminal output (tmux buffer
after run, essentially) will be saved under the same name but with .txt.

  #!/usr/bin/env bash

pid=/tmp/picom.pid

[ -z "$1" ] && echo -e "usage: \ntest2.sh 'results-folder-name'" && exit 1

clear

results="$HOME/picom/$1"

mkdir -p $results

run() {
    opts="$1, $4, SyncToVBlank=$2, AllowFlipping=$3"
    echo "Running with $opts"

    nvidia-settings -a "SyncToVBlank=$2" >/dev/null
    nvidia-settings -a "AllowFlipping=$3" >/dev/null

    picom $4 -b --write-pid-path="$pid" \
        --experimental-backends --backend="$1" \
        --config=/dev/null

    sleep 0.5s

    hyperfine --export-json "$results/$opts.json" \
        -w 3 -r 100 \
        'alacritty --class floatme,floatme -e false'

    kill "$(cat $pid)"

    sleep 0.5s
}

figlet 'Xorg options:'

grep -P '(Triple|ForceComp)' /etc/X11/xorg.conf.d/20-nvidia.conf

echo -e '\n\n'
figlet 'GLX'
echo -e '\n***   --no-vsync   ***\n'

run glx 0 0 --no-vsync
run glx 0 1 --no-vsync
run glx 1 0 --no-vsync
run glx 1 1 --no-vsync

echo -e '\n***     --vsync    ***\n'

run glx 0 0 --vsync
run glx 0 1 --vsync
run glx 1 0 --vsync
run glx 1 1 --vsync


echo -e '\n\n'
figlet 'XRENDER'
echo -e '\n***   --no-vsync   ***\n'

run xrender 0 0 --no-vsync
run xrender 0 1 --no-vsync
run xrender 1 0 --no-vsync
run xrender 1 1 --no-vsync

echo -e '\n***     --vsync    ***\n'

run xrender 0 0 --vsync
run xrender 0 1 --vsync
run xrender 1 0 --vsync
run xrender 1 1 --vsync

tmux capture-pane -pS -1000000 > "$results.txt"
sort-times.py

This script goes through every folder (Xorg options) under set results (set to ~/picom, or run it inside),
parses hyperfine's .json files and outputs pretty table and runs.json file,
like you seen above.

#!/usr/bin/env python3

import json
import os
from typing import Iterable

# https://pypi.org/project/tabulate/
from tabulate import tabulate

# $results from test2.sh
results = './'


def find(results: str) -> Iterable[str]:
    '''
    Finds every .json file in subdirectories of the `results` directory,
    ignores files in `results`'s root.
    '''
    for dirpath, _, filenames in os.walk(results):
        for fn in filenames:
            if os.path.splitext(fn)[1] == '.json' and dirpath != './':
                yield os.path.join(dirpath, fn)


def parse(fp: str) -> dict:
    '''
    Takes file path to .json result of a run, returns dict with parsed options used / latency
    '''
    run = {}

    name = os.path.splitext(os.path.basename(fp))[0]
    run['backend'] = name.split(',')[0]
    run['picom_vsync'] = name.find('--vsync') != -1
    run['sync_to_vblank'] = name.find('SyncToVBlank=1') != -1
    run['allow_flipping'] = name.find('AllowFlipping=1') != -1

    dir = os.path.basename(os.path.dirname(fp))
    run['triple_buffer'] = dir.find('no-3b') == -1
    run['ffcp'] = dir.find('no-ffcp') == -1
    run['patched'] = dir.find('def') == -1

    with open(fp, 'r', encoding='utf-8') as f:
        timings = json.load(f)

    # to ms
    run['mean'] = round(timings['results'][0]['mean'] * 1000)
    run['median'] = round(timings['results'][0]['median'] * 1000)
    run['stddev'] = round(timings['results'][0]['stddev'] * 1000, 2)

    return run


runs = [parse(fp) for fp in find(results)]

runs = sorted(runs, key=lambda r: r['mean'])

with open('./runs.json', 'w', encoding='utf-8') as ff:
    json.dump(runs, ff, indent=2)

# for markdown set tablefmt='github'
print(tabulate(runs, tablefmt="fancy_grid", headers='keys'))

Here is a notebook selecting rows with various options to get a feel for latency.

picom-data.tar.gz

Also, if you notice that after reboot everything is slow again, remember that

The NVIDIA X driver does not preserve values set with nvidia-settings between runs of the X server.

from nvidia-settings man page.

So don't forget to add nvidia-settings --load-config-only in autostart. I don't yet know how to set allow flipping = 0 and sync to vblack = 0 in Xorg.conf .

@kwand
Copy link

kwand commented Jan 20, 2022

@MahouShoujoMivutilde Very sorry for the late reply. This is not much of an update, but I just wanted to let you know that I have read your reply and actually switched to using settings that give the lowest latency (as per your results) a month ago.

The results seem to be right as I seem to notice some latency improvement. But it still puzzles me why there's such a huge difference and how we could improve picom's performance (OK, maybe not a "huge difference". 22-23ms seems to be just slightly more than one frame of latency worse than FFCP, assuming your display is 60Hz)

I have yet to run your tests on my own machine though, but I imagine I'll probably discover something once I do (as I'm now using a 160Hz display). I also have access to a laptop running AMD graphics now, so I want to do some investigation in that area to see if this is NVIDIA-specific problem or something inherent in picom.

Sorry, I've just been really short on time lately, though I would really love to fix this problem myself (I get pretty annoyed at the latency difference when I notice how fast everything is when I need to kill picom sometimes, and when comparing picom to Windows).

If anyone has the time, I think this is a pretty high-priority issue that could be looked into. Investigating how KDE handles their compositing v-sync algorithm might also be worthwhile, since apparently they have a superior algorithm than picom's.

I haven't daily-driven Plasma on my main machine yet (running awesome-wm now), so I can't say much about their claims of latency improvement - though I do know that they were quite infamous for terrible latency before that latency-improving update. Since many people are claiming that issue is fixed, I'd imagine it has to have been quite a significant improvement (or maybe they became too used to terrible latency that any improvement looked subjectively better. I don't know)

@apprehensions
Copy link

sorry to notify literally any one associated with this thread, but just a question:
Is xrender better than GLX backend on nvidia propietary drivers?
and what can i do to lower latency for both backends?
i have disabled Flipping which made it much smoother,

    Option         "ForceFullCompositionPipeline" "on"
    Option         "AllowIndirectGLXProtocol" "off"
    Option         "TripleBuffer" "on"

for me picom can take up to 20% cpu (i use animations) and gpu takes 70% with 70W average.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issue related to performance
Projects
None yet
Development

No branches or pull requests

6 participants
@yshui @MahouShoujoMivutilde @kwand @apprehensions @ro-i and others