perf(gui): Resolve massive frametime bloat by throttling telemetry and optimizing UI updates
This commit is contained in:
9
gui.py
9
gui.py
@@ -518,8 +518,9 @@ class App:
|
||||
ai_client.tool_log_callback = self._on_tool_log
|
||||
mcp_client.perf_monitor_callback = self.perf_monitor.get_metrics
|
||||
self.perf_monitor.alert_callback = self._on_performance_alert
|
||||
self._last_bleed_update_time = 0
|
||||
self._last_diag_update_time = 0
|
||||
self._last_perf_update_time = 0
|
||||
self._last_bleed_update_time = 0
|
||||
self._last_script_alpha = -1
|
||||
self._last_resp_alpha = -1
|
||||
self._recalculate_session_usage()
|
||||
@@ -837,7 +838,7 @@ class App:
|
||||
dpg.set_value("token_budget_label", f"{current:,} / {limit:,}")
|
||||
|
||||
# Update Gemini-specific cache stats (throttled with diagnostics)
|
||||
if now - self._last_diag_update_time > 0.1:
|
||||
if now - self._last_diag_update_time > 10.0:
|
||||
self._last_diag_update_time = now
|
||||
|
||||
if dpg.does_item_exist("gemini_cache_label"):
|
||||
@@ -856,7 +857,9 @@ class App:
|
||||
else:
|
||||
dpg.configure_item("gemini_cache_label", show=False)
|
||||
|
||||
# Update Diagnostics panel
|
||||
# Update Diagnostics panel (throttled for smoothness)
|
||||
if now - self._last_perf_update_time > 0.5:
|
||||
self._last_perf_update_time = now
|
||||
if dpg.is_item_shown("win_diagnostics"):
|
||||
metrics = self.perf_monitor.get_metrics()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user