Source: Full code review 2026-07-17 (docs/reviews/2026-07-17-full-code-review.md), finding F9.
Category: performance / cleanup · Severity: low · Effort: small
Problem
TemperatureCollector (measure_temp, internal/collector/temperature.go:195-204) and ThrottledCollector (get_throttled, internal/collector/throttled.go:90-96) each fork+exec vcgencmd on every fast tick — two subprocesses per 5-second tick on the hot path, each with its own 5 s timeout that counts against the tick budget. The two collectors also duplicate the lazy-redetect logic (redetectVcgencmdLocked) verbatim.
Suggested fix
Extract a small shared vcgencmd runner (single detection + throttled re-detection + run(ctx, subcommand) helper) used by both collectors. Optionally batch both readings per tick through it; halves the exec rate and removes the duplication.
Source: Full code review 2026-07-17 (
docs/reviews/2026-07-17-full-code-review.md), finding F9.Category: performance / cleanup · Severity: low · Effort: small
Problem
TemperatureCollector(measure_temp,internal/collector/temperature.go:195-204) andThrottledCollector(get_throttled,internal/collector/throttled.go:90-96) each fork+execvcgencmdon every fast tick — two subprocesses per 5-second tick on the hot path, each with its own 5 s timeout that counts against the tick budget. The two collectors also duplicate the lazy-redetect logic (redetectVcgencmdLocked) verbatim.Suggested fix
Extract a small shared vcgencmd runner (single detection + throttled re-detection +
run(ctx, subcommand)helper) used by both collectors. Optionally batch both readings per tick through it; halves the exec rate and removes the duplication.