#63 Lagginess with x11 linux 6 months ago

Comment by ~kaey on ~eliasnaur/gio

Could you guys give it a try and see how it affects all of you?

This is without compositor. With vsync enabled lag is the same, but movement is choppier than on master branch. With vsync disabled result is the same as on master - no lag and redraws at 2k fps.

#254 git pull is very slow in Russia 6 months ago

Ticket created by ~kaey on ~sircmpwn/git.sr.ht

$ time git pull
Already up to date.

real    0m39.003s
user    0m0.013s
sys     0m0.009s

Next runs are much faster, because of enabled ControlSocket in ssh config, but still jump to 10-15 secs periodically.

$ time git pull
Already up to date.

real    0m0.721s
user    0m0.010s
sys     0m0.003s

Part of traceroute output to git.sr.ht

4  bb-m9.westcall.ru (  2.615 ms  4.072 ms (  2.454 ms
 5  * * (  38.266 ms
 6  be4766.nr21.b015761-2.fra06.atlas.cogentco.com (  42.934 ms frm-nt-cr1.be8.rascom.as20764.net (  40.006 ms be4766.nr21.b015761-2.fra06.atlas.cogentco.com (  46.902 ms
 7 (  38.851 ms  41.926 ms  41.916 ms
 8  be2846.ccr42.fra03.atlas.cogentco.com (  46.212 ms  46.089 ms (  114.857 ms

And to sr.ht

8  asr-m9.westcall.ru (  3.837 ms  3.850 ms asr-m9.westcall.ru (  2.943 ms
 9  asr-m9.westcall.ru (  3.819 ms *  3.873 ms
10  * * *
11  frm-nt-cr1.be2.rascom.as20764.net (  40.963 ms * frm-nt-cr1.be8.rascom.as20764.net (  39.952 ms
12 (  116.689 ms frm-nt-cr1.be8.rascom.as20764.net (  39.135 ms *
13  li902-217.members.linode.com (  118.764 ms * *

#63 Lagginess with x11 linux 6 months ago

Comment by ~kaey on ~eliasnaur/gio

Fullscreen applications (like shooters) have the easy option to bypass the compositor

i3 is not a compositor so it's not a problem.

thus reducing lag even with vsync, which can be further reduced by using XCB where available

Vsync is problematic for games on windows as well it isn't xorg specific problem. I don't know any games that run on wayland AND use frame callback described by Elias so can't test there. Gio is not for games of course so some lag is fine, but I just tried moving box in firefox on https://draw.io and lag is comparable to gio on sway. It may be worth examining what FF is doing (with opengl debugger maybe).

disabling vsync in Gio is not an option (think CPU usage & battery drain on laptops).

vsync is about tearing, fps limit is about cpu usage. People use 240hz monitors, is it worth running gio animations at 240 fps? Fps limit should be present irregardless of vsync setting.

#67 Closing window sometimes leads to panic 6 months ago

Comment by ~kaey on ~eliasnaur/gio

Looks like it's fixed. Thanks.


#67 Closing window sometimes leads to panic 6 months ago

Ticket created by ~kaey on ~eliasnaur/gio

arch linux, x11, amdgpu, i3wm, gioui.org v0.0.0-20191111125045-2e0406802b84

Repro: build example/hello run it ./hello and close window, repeat 3-10 times, until it panics

Sample panic text: ``` fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x1bcb pc=0x7ff86cafe470]

runtime stack: runtime.throw(0x5a2fc6, 0x2a) /usr/lib/go/src/runtime/panic.go:774 +0x72 runtime.sigpanic() /usr/lib/go/src/runtime/signal_unix.go:378 +0x47c

goroutine 18 [syscall]: runtime.cgocall(0x533580, 0xc000053f28, 0xc000053f20) /usr/lib/go/src/runtime/cgocall.go:128 +0x5b fp=0xc000053ef8 sp=0xc000053ec0 pc=0x40cc4b gioui.org/app/internal/window.CfuncXCloseDisplay(0x7ff854003c20, 0x7ff800000000) cgogotypes.go:900 +0x49 fp=0xc000053f28 sp=0xc000053ef8 pc=0x4e61c9 gioui.org/app/internal/window.(x11Window).destroy.func4(0xc00029c000, 0x1) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/window/os_x11.go:198 +0x5f fp=0xc000053f68 sp=0xc000053f28 pc=0x4f79ef gioui.org/app/internal/window.(x11Window).destroy(0xc00029c000) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/window/osx11.go:198 +0x6b fp=0xc000053f90 sp=0xc000053f68 pc=0x4f28bb gioui.org/app/internal/window.newX11Window.func11(0xc00029c000) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/window/osx11.go:536 +0x6a fp=0xc000053fd8 sp=0xc000053f90 pc=0x4f850a runtime.goexit() /usr/lib/go/src/runtime/asmamd64.s:1357 +0x1 fp=0xc000053fe0 sp=0xc000053fd8 pc=0x461631 created by gioui.org/app/internal/window.newX11Window /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/window/osx11.go:532 +0x536

goroutine 1 [chan receive]: gioui.org/app/internal/window.Main(...) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/window/os_unix.go:14 gioui.org/app.Main(...) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/app.go:52 main.main() /home/kaey/tmp/test/main.go:33 +0x50

goroutine 7 [runnable]: gioui.org/app/internal/gpu.(GPU).Release(...) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/internal/gpu/gpu.go:376 gioui.org/app.(Window).run.func1(0xc00000c1e0) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/window.go:223 +0x63 gioui.org/app.(*Window).run(0xc00000c1e0, 0xc00000e0a0) /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/window.go:318 +0x13ee created by gioui.org/app.NewWindow /home/kaey/local/pkg/mod/gioui.org@v0.0.0-20191111125045-2e0406802b84/app/window.go:100 +0x202 ```

#63 Lagginess with x11 linux 6 months ago

Comment by ~kaey on ~eliasnaur/gio

I also reproduce this problem on amdgpu and i3wm with gio v0.0.0-20191111125045-2e0406802b84 tot and draw times are stable 16ms without drops. If i export vblank_mode=0 draw times drop to 100us and lag is gone, but tearing is introduced.

As a side note, (almost) every shooter game suffers from input lag with vsync enabled, general solution is to disable vsync and set fps limit to 120.