From 8db5b64dcfdd9c75e8b9b8dc42f9b263fa00b64b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 5 Mar 2026 23:18:34 +0200 Subject: Add flamegraph benchmark suite and reuse hot-path buffers --- internal/tui/flamegraph/model.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/tui/flamegraph/model.go') diff --git a/internal/tui/flamegraph/model.go b/internal/tui/flamegraph/model.go index ddf40fd..5f5a83c 100644 --- a/internal/tui/flamegraph/model.go +++ b/internal/tui/flamegraph/model.go @@ -139,7 +139,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.animating = m.animation.Tick(0) m.frames = m.animation.CurrentFrames() m.clampSelection() - m.subtreeSet = computeSubtreeSet(m.frames, m.selectedIdx) + m.subtreeSet = computeSubtreeSetInto(m.frames, m.selectedIdx, m.subtreeSet) if m.animating { return m, animTickCmd() } @@ -202,7 +202,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.moveSibling(1) } if m.selectedIdx != prev { - m.subtreeSet = computeSubtreeSet(m.frames, m.selectedIdx) + m.subtreeSet = computeSubtreeSetInto(m.frames, m.selectedIdx, m.subtreeSet) } } return m, nil @@ -319,7 +319,7 @@ func (m *Model) rebuildFrames(animate bool) { m.frames = append(m.frames[:0], m.targetFrames...) } m.clampSelection() - m.subtreeSet = computeSubtreeSet(m.frames, m.selectedIdx) + m.subtreeSet = computeSubtreeSetInto(m.frames, m.selectedIdx, m.subtreeSet) } func (m *Model) zoomIn() { -- cgit v1.2.3