Efficiency batch 2

D2 — update() in starpilot_onroad.cc now only fires when at least one overlay (showBlindspot, showSignal, showSteering, showFPS) is active. ~30–60 wasted repaints/sec eliminated when all overlays are off.

E4 — Holiday theme check reordered so current_holiday_theme != "stock" (cheapest) is first. Default is stock, so the rest of the chain never evaluates on a normal non-holiday drive.

E7 — paintSteeringTorqueBorder no longer rebuilds the QLinearGradient and computes lighter(120)/setAlpha/5 setColorAt calls every frame. The gradient is now built once in resizeEvent and reused. The per-frame work is now just the two geometry calculations and fillRect.

E5/E6/E8 — Audited clean: all remaining params_memory.put calls are event-driven (button presses, random events), no hot-path logging exists in the UI code, and all QTimers are event-driven or single-shot offroad dialogs.
This commit is contained in:
whoisdomi
2026-05-05 17:09:57 -05:00
committed by firestar5683
parent c1d3e4540b
commit 78d5f71fed
3 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ class StarPilotEvents:
else:
self.stopped_for_light = False
if "holidayActive" not in self.played_events and self.startup_seen and alerts_empty and len(self.events) == 0 and starpilot_toggles.current_holiday_theme != "stock":
if starpilot_toggles.current_holiday_theme != "stock" and "holidayActive" not in self.played_events and self.startup_seen and alerts_empty and len(self.events) == 0:
self.events.add(StarPilotEventName.holidayActive)
if self.starpilot_planner.tracking_lead and sm["carState"].standstill and sm["carState"].gearShifter not in NON_DRIVING_GEARS: