From bc410c4261f12377a2eb7ea08f4112a1a9574a77 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 21 Apr 2026 18:00:59 +0300 Subject: perf: reduce headless server render overhead --- src/app/runtime.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/app/runtime.rs') diff --git a/src/app/runtime.rs b/src/app/runtime.rs index b6ad806b..739a3670 100644 --- a/src/app/runtime.rs +++ b/src/app/runtime.rs @@ -1,4 +1,4 @@ -use std::time::Instant; +use std::time::{Duration, Instant}; use crossterm::terminal; @@ -171,9 +171,16 @@ impl App { } pub(crate) fn sync_animation_timer(&mut self, now: Instant) { + self.sync_animation_timer_with_interval(now, ANIMATION_INTERVAL); + } + + pub(crate) fn sync_headless_animation_timer(&mut self, now: Instant) { + self.sync_animation_timer_with_interval(now, crate::app::HEADLESS_ANIMATION_INTERVAL); + } + + fn sync_animation_timer_with_interval(&mut self, now: Instant, interval: Duration) { if self.agent_panel_has_animation() { - self.next_animation_tick - .get_or_insert(now + ANIMATION_INTERVAL); + self.next_animation_tick.get_or_insert(now + interval); } else { self.next_animation_tick = None; } -- cgit v1.2.3