detached f2587ab

test(wayland): report fresh frames per op in the capture benchmark

commit
f2587abc42678fa2877fc292a387bac0eff51dd3
author
brice · · 2026-09-30 19:56 UTC
committer
brice · · 2026-10-01 02:26 UTC
parent
037ee43
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +5 -1
M internal/adapters/wayland/source_test.go +5 -1
@@ -437,8 +437,11 @@ func TestCaptureAllocations(t *testing.T) {
437437 require.LessOrEqual(t, avg, float64(allocBudget))
438438 }
439439
440+// BenchmarkCapture measures Capture in a tight loop. The compositor needs
441+// longer than the poll to fill a frame, so many calls repeat the last frame;
442+// fresh-frames/op says how many were new.
440443 func BenchmarkCapture(b *testing.B) {
441- s, _ := newSource(b, testserver.Config{Outputs: []testserver.OutputSpec{{Name: "BENCH", Width: 1920, Height: 1080, Scale: 1}}})
444+ s, srv := newSource(b, testserver.Config{Outputs: []testserver.OutputSpec{{Name: "BENCH", Width: 1920, Height: 1080, Scale: 1}}})
442445 target := ports.Target{OutputID: firstOutput(b, s).ID}
443446 ctx := context.Background()
444447 b.ReportAllocs()
@@ -449,6 +452,7 @@ func BenchmarkCapture(b *testing.B) {
449452 b.Fatal(err)
450453 }
451454 }
455+ b.ReportMetric(float64(srv.Stats().Ready)/float64(b.N), "fresh-frames/op")
452456 }
453457
454458 // Opt-in: NEFERCAP_WAYLAND_SOCKET names the socket of a disposable headless
@@ -437,8 +437,11 @@ func TestCaptureAllocations(t *testing.T) {
437 require.LessOrEqual(t, avg, float64(allocBudget))437 require.LessOrEqual(t, avg, float64(allocBudget))
438 }438 }
439 439
440+// BenchmarkCapture measures Capture in a tight loop. The compositor needs
441+// longer than the poll to fill a frame, so many calls repeat the last frame;
442+// fresh-frames/op says how many were new.
440 func BenchmarkCapture(b *testing.B) {443 func BenchmarkCapture(b *testing.B) {
441- s, _ := newSource(b, testserver.Config{Outputs: []testserver.OutputSpec{{Name: "BENCH", Width: 1920, Height: 1080, Scale: 1}}})444+ s, srv := newSource(b, testserver.Config{Outputs: []testserver.OutputSpec{{Name: "BENCH", Width: 1920, Height: 1080, Scale: 1}}})
442 target := ports.Target{OutputID: firstOutput(b, s).ID}445 target := ports.Target{OutputID: firstOutput(b, s).ID}
443 ctx := context.Background()446 ctx := context.Background()
444 b.ReportAllocs()447 b.ReportAllocs()
@@ -449,6 +452,7 @@ func BenchmarkCapture(b *testing.B) {
449 b.Fatal(err)452 b.Fatal(err)
450 }453 }
451 }454 }
455+ b.ReportMetric(float64(srv.Stats().Ready)/float64(b.N), "fresh-frames/op")
452 }456 }
453 457
454 // Opt-in: NEFERCAP_WAYLAND_SOCKET names the socket of a disposable headless458 // Opt-in: NEFERCAP_WAYLAND_SOCKET names the socket of a disposable headless

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 2

Tags 9

↑↓ moveenter openesc close