detached 35f7ff1

perf: zero allocations per Present and frame round trip (wlturbo v0.6.2) (#1)

commit
35f7ff11b7082303674524f72794ec262fd91209
author
bnema · · 2026-10-01 20:26 UTC
committer
GitHub · · 2026-10-01 20:26 UTC
parent
f2db2fe
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
5 files · +13 -16
M alloc_test.go +4 -7
@@ -137,11 +137,8 @@ func TestAllocPresent(t *testing.T) {
137137 t.Logf("allocs per Present (requests only): %v", allocs)
138138 require.Zero(t, allocs)
139139
140- // The complete cycle adds the frame callback. wlturbo registers each
141- // server-created wl_callback with two sync.Map stores (Context.proxies and
142- // Display.objects) and a sync.Map store always allocates a node, so two
143- // allocations per frame are inherent to the transport (wlturbo is out of
144- // scope for this change). They are pinned so a regression above that shows.
140+ // The complete cycle adds the frame callback, registered under a recycled
141+ // ID in wlturbo's object tables.
145142 s.UseWireRequests()
146143 h := &countingHandler{}
147144 cycle := func() {
@@ -158,8 +155,8 @@ func TestAllocPresent(t *testing.T) {
158155 cycle()
159156 }
160157 full := testing.AllocsPerRun(100, cycle)
161- t.Logf("allocs per Present+frame round trip: %v (wlturbo callback registration)", full)
162- require.LessOrEqual(t, full, 2.0)
158+ t.Logf("allocs per Present+frame round trip: %v", full)
159+ require.Zero(t, full)
163160 require.Positive(t, h.frames)
164161 require.Zero(t, h.errs)
165162 }
@@ -137,11 +137,8 @@ func TestAllocPresent(t *testing.T) {
137 t.Logf("allocs per Present (requests only): %v", allocs)137 t.Logf("allocs per Present (requests only): %v", allocs)
138 require.Zero(t, allocs)138 require.Zero(t, allocs)
139 139
140- // The complete cycle adds the frame callback. wlturbo registers each140+ // The complete cycle adds the frame callback, registered under a recycled
141- // server-created wl_callback with two sync.Map stores (Context.proxies and141+ // ID in wlturbo's object tables.
142- // Display.objects) and a sync.Map store always allocates a node, so two
143- // allocations per frame are inherent to the transport (wlturbo is out of
144- // scope for this change). They are pinned so a regression above that shows.
145 s.UseWireRequests()142 s.UseWireRequests()
146 h := &countingHandler{}143 h := &countingHandler{}
147 cycle := func() {144 cycle := func() {
@@ -158,8 +155,8 @@ func TestAllocPresent(t *testing.T) {
158 cycle()155 cycle()
159 }156 }
160 full := testing.AllocsPerRun(100, cycle)157 full := testing.AllocsPerRun(100, cycle)
161- t.Logf("allocs per Present+frame round trip: %v (wlturbo callback registration)", full)158+ t.Logf("allocs per Present+frame round trip: %v", full)
162- require.LessOrEqual(t, full, 2.0)159+ require.Zero(t, full)
163 require.Positive(t, h.frames)160 require.Positive(t, h.frames)
164 require.Zero(t, h.errs)161 require.Zero(t, h.errs)
165 }162 }
M examples/go.mod +2 -2
@@ -4,7 +4,7 @@ go 1.27
44
55 require (
66 github.com/bnema/neferclient v0.1.0
7- github.com/bnema/nefergui v0.5.0
7+ github.com/bnema/nefergui v0.5.1
88 )
99
1010 require (
@@ -12,7 +12,7 @@ require (
1212 github.com/bnema/purego v0.13.0-bnema.1 // indirect
1313 github.com/bnema/purego-vulkan v0.6.0 // indirect
1414 github.com/bnema/purego-xkbcommon v0.2.0 // indirect
15- github.com/bnema/wlturbo v0.6.1 // indirect
15+ github.com/bnema/wlturbo v0.6.2 // indirect
1616 github.com/go-text/typesetting v0.3.5 // indirect
1717 golang.org/x/image v0.46.0 // indirect
1818 golang.org/x/sys v0.48.0 // indirect
@@ -4,7 +4,7 @@ go 1.27
4 4
5 require (5 require (
6 github.com/bnema/neferclient v0.1.06 github.com/bnema/neferclient v0.1.0
7- github.com/bnema/nefergui v0.5.07+ github.com/bnema/nefergui v0.5.1
8 )8 )
9 9
10 require (10 require (
@@ -12,7 +12,7 @@ require (
12 github.com/bnema/purego v0.13.0-bnema.1 // indirect12 github.com/bnema/purego v0.13.0-bnema.1 // indirect
13 github.com/bnema/purego-vulkan v0.6.0 // indirect13 github.com/bnema/purego-vulkan v0.6.0 // indirect
14 github.com/bnema/purego-xkbcommon v0.2.0 // indirect14 github.com/bnema/purego-xkbcommon v0.2.0 // indirect
15- github.com/bnema/wlturbo v0.6.1 // indirect15+ github.com/bnema/wlturbo v0.6.2 // indirect
16 github.com/go-text/typesetting v0.3.5 // indirect16 github.com/go-text/typesetting v0.3.5 // indirect
17 golang.org/x/image v0.46.0 // indirect17 golang.org/x/image v0.46.0 // indirect
18 golang.org/x/sys v0.48.0 // indirect18 golang.org/x/sys v0.48.0 // indirect
M examples/go.sum +4 -4 generated file: collapsed
M go.mod +1 -1
@@ -5,7 +5,7 @@ go 1.27
55 require (
66 github.com/bnema/go-wayland-bindings v0.1.0
77 github.com/bnema/purego-xkbcommon v0.2.0
8- github.com/bnema/wlturbo v0.6.1
8+ github.com/bnema/wlturbo v0.6.2
99 github.com/stretchr/testify v1.12.1
1010 golang.org/x/sys v0.48.0
1111 )
@@ -5,7 +5,7 @@ go 1.27
5 require (5 require (
6 github.com/bnema/go-wayland-bindings v0.1.06 github.com/bnema/go-wayland-bindings v0.1.0
7 github.com/bnema/purego-xkbcommon v0.2.07 github.com/bnema/purego-xkbcommon v0.2.0
8- github.com/bnema/wlturbo v0.6.18+ github.com/bnema/wlturbo v0.6.2
9 github.com/stretchr/testify v1.12.19 github.com/stretchr/testify v1.12.1
10 golang.org/x/sys v0.48.010 golang.org/x/sys v0.48.0
11 )11 )
M go.sum +2 -2
@@ -4,8 +4,8 @@ github.com/bnema/purego v0.13.0-bnema.1 h1:fKRdztnvTmRqAjANMoN+utEIH73dvPqVPJh2i
44 github.com/bnema/purego v0.13.0-bnema.1/go.mod h1:xS1iX3noypxnbOUEUAqOvkfnUzgHuu19VtL4+dfUMJM=
55 github.com/bnema/purego-xkbcommon v0.2.0 h1:UWh5rSJIBhYImg8wZ98UzK4QNt7gvkKR6gFseO21mtg=
66 github.com/bnema/purego-xkbcommon v0.2.0/go.mod h1:GE8JGmR/rqdklz96tFaFU7M5kI7jN1ma5mh+rz+XXrg=
7-github.com/bnema/wlturbo v0.6.1 h1:iprJoRs+4duIsiemPVPSmN3qdp0Nbh2iLJ5VMwcY0fY=
8-github.com/bnema/wlturbo v0.6.1/go.mod h1:4i1k1wyw7FDWOkh2hg1ZwPfrPRn3+E6WrYg9Qrt74CA=
7+github.com/bnema/wlturbo v0.6.2 h1:wV+NlplUoh6wG9E9ZKsPATMDSrTaiez3+T0xCDFZZjg=
8+github.com/bnema/wlturbo v0.6.2/go.mod h1:4i1k1wyw7FDWOkh2hg1ZwPfrPRn3+E6WrYg9Qrt74CA=
99 github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
1010 github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
1111 github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
@@ -4,8 +4,8 @@ github.com/bnema/purego v0.13.0-bnema.1 h1:fKRdztnvTmRqAjANMoN+utEIH73dvPqVPJh2i
4 github.com/bnema/purego v0.13.0-bnema.1/go.mod h1:xS1iX3noypxnbOUEUAqOvkfnUzgHuu19VtL4+dfUMJM=4 github.com/bnema/purego v0.13.0-bnema.1/go.mod h1:xS1iX3noypxnbOUEUAqOvkfnUzgHuu19VtL4+dfUMJM=
5 github.com/bnema/purego-xkbcommon v0.2.0 h1:UWh5rSJIBhYImg8wZ98UzK4QNt7gvkKR6gFseO21mtg=5 github.com/bnema/purego-xkbcommon v0.2.0 h1:UWh5rSJIBhYImg8wZ98UzK4QNt7gvkKR6gFseO21mtg=
6 github.com/bnema/purego-xkbcommon v0.2.0/go.mod h1:GE8JGmR/rqdklz96tFaFU7M5kI7jN1ma5mh+rz+XXrg=6 github.com/bnema/purego-xkbcommon v0.2.0/go.mod h1:GE8JGmR/rqdklz96tFaFU7M5kI7jN1ma5mh+rz+XXrg=
7-github.com/bnema/wlturbo v0.6.1 h1:iprJoRs+4duIsiemPVPSmN3qdp0Nbh2iLJ5VMwcY0fY=7+github.com/bnema/wlturbo v0.6.2 h1:wV+NlplUoh6wG9E9ZKsPATMDSrTaiez3+T0xCDFZZjg=
8-github.com/bnema/wlturbo v0.6.1/go.mod h1:4i1k1wyw7FDWOkh2hg1ZwPfrPRn3+E6WrYg9Qrt74CA=8+github.com/bnema/wlturbo v0.6.2/go.mod h1:4i1k1wyw7FDWOkh2hg1ZwPfrPRn3+E6WrYg9Qrt74CA=
9 github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=9 github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
10 github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=10 github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
11 github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=11 github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 4

↑↓ moveenter openesc close