profiling.md RawHistoryFolder

Profiling

Run these from another TTY or over SSH:

# CPU, Go and C frames
perf record -g -p (pgrep -f bin/neferwl) -- sleep 8
perf report --children --percent-limit 1

# Allocations
neferwl --backend=drm --pprof=localhost:6060
go tool pprof -sample_index=alloc_objects -top http://localhost:6060/debug/pprof/heap

# One line per GC cycle
GODEBUG=gctrace=1 neferwl --backend=drm

make tty serves pprof on localhost:6060 by default (make tty PPROF= turns it off).

Logs are in ~/.local/state/neferwl/runs/<backend>/, with latest.log pointing at the newest run. --debug=all enables every category except the noisy drm-flip, input-motion, input-keys, wayland-damage (one client damage entry per client commit) and render-damage (one frame damage entry per rendered frame); name them to turn them on.

Frame stats

Every 10 s, each output logs a stats entry:

Field Meaning
missed_vblanks Frames that flipped more than 1.5 refresh periods late (not counted under VRR)
max_flip_interval_ms Longest gap between two flips
max_commit_delay_ms Longest wait from "frame due" to commit
late_fences Missed vblanks where the GPU finished too late (needs --debug=drm-flip)
redrawn_pixels Pixels drawn

If outputs report flips faster than the display loop reads them, wayland merges them and logs a warning with merged at most every 10 s.

Missed vblanks with late_fences mean the GPU was late. Without late_fences but with a large max_commit_delay_ms, the CPU was late.

source
1# Profiling
2
3Run these from another TTY or over SSH:
4
5```sh
6# CPU, Go and C frames
7perf record -g -p (pgrep -f bin/neferwl) -- sleep 8
8perf report --children --percent-limit 1
9
10# Allocations
11neferwl --backend=drm --pprof=localhost:6060
12go tool pprof -sample_index=alloc_objects -top http://localhost:6060/debug/pprof/heap
13
14# One line per GC cycle
15GODEBUG=gctrace=1 neferwl --backend=drm
16```
17
18`make tty` serves pprof on `localhost:6060` by default (`make tty PPROF=` turns it off).
19
20Logs are in `~/.local/state/neferwl/runs/<backend>/`, with `latest.log` pointing at the newest run. `--debug=all` enables every category except the noisy `drm-flip`, `input-motion`, `input-keys`, `wayland-damage` (one `client damage` entry per client commit) and `render-damage` (one `frame damage` entry per rendered frame); name them to turn them on.
21
22## Frame stats
23
24Every 10 s, each output logs a `stats` entry:
25
26| Field | Meaning |
27|---|---|
28| `missed_vblanks` | Frames that flipped more than 1.5 refresh periods late (not counted under VRR) |
29| `max_flip_interval_ms` | Longest gap between two flips |
30| `max_commit_delay_ms` | Longest wait from "frame due" to commit |
31| `late_fences` | Missed vblanks where the GPU finished too late (needs `--debug=drm-flip`) |
32| `redrawn_pixels` | Pixels drawn |
33
34If outputs report flips faster than the display loop reads them, wayland merges them and logs a warning with `merged` at most every 10 s.
35
36Missed vblanks with `late_fences` mean the GPU was late. Without `late_fences` but with a large `max_commit_delay_ms`, the CPU was late.

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 25

Tags 10

↑↓ moveenter openesc close