You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/PROFILING.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ Press `` ` `` (backtick) to toggle the profiler overlay. While it's open:
8
8
9
9
-`>` or `.` — decrease tick rate by 10ms (faster updates, more CPU)
10
10
-`<` or `,` — increase tick rate by 10ms (slower updates, less CPU)
11
+
-`}` — increase smoothing by 5% (smoother bars, more visual lag)
12
+
-`{` — decrease smoothing by 5% (snappier bars, more jitter)
11
13
12
14
## Reading the Profiler
13
15
@@ -67,11 +69,35 @@ These should be well under 100µs each. If IPC poll is consistently high, it may
67
69
|**Idle wait**| Time spent sleeping in `event::poll()`, waiting for input or timeout. This is not CPU work. |
68
70
|**Frame**| Full wall-clock time per loop iteration (work + idle) |
69
71
72
+
Idle wait and Frame use **inverted color coding**: high values are green (the CPU is mostly sleeping, which is good), low values are red (the app is struggling to find idle time).
73
+
74
+
### Visualizer Responsiveness
75
+
76
+
This section shows how quickly the visualizer bars react to changes in the audio signal.
77
+
78
+
```
79
+
Smoothing 70% │ { } adjust
80
+
Settling 7 frames (~70ms @ 10ms tick)
81
+
```
82
+
83
+
**Smoothing** is the noise reduction weight used in the visualizer's integral smoothing (an exponential moving average). Higher values produce smoother, more flowing bar animation but introduce visual lag. Lower values make bars snap to the audio faster but may look jittery. The default is 70% (CAVA uses 77%). Adjustable in 5% steps with `{` and `}`.
84
+
85
+
**Settling** is the theoretical number of frames for bars to reach 90% of a new target value, calculated as `⌈ln(0.1) / ln(smoothing)⌉`. The millisecond estimate multiplies this by your current tick rate. Color coding: green under 200ms, yellow under 500ms, red above.
The smoothing value is runtime-only and resets to the default (70%) on restart.
95
+
70
96
### The avg and max Columns
71
97
72
98
**avg** is the mean over the rolling window. **max** is the highest value seen in that same window. Both use a 2-second rolling window (~60 frames), so old spikes fall off naturally — you're always seeing recent performance, not a startup spike from minutes ago.
73
99
74
-
Max values are color-coded: green under 5,000µs, yellow under 10,000µs, red above.
100
+
For CPU work metrics (Draw, Key input, IPC poll, Visualizer, CPU work), values are color-coded where low is green and high is red. For idle metrics (Idle wait, Frame), the coloring is inverted — high values are green because they indicate the CPU is mostly sleeping.
0 commit comments