summaryrefslogtreecommitdiff
path: root/internal/tui/flamegraph/model.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-05 23:18:34 +0200
committerPaul Buetow <paul@buetow.org>2026-03-05 23:18:34 +0200
commit8db5b64dcfdd9c75e8b9b8dc42f9b263fa00b64b (patch)
treed0ee37858de76eec0fdc1587764fa9355ed39f91 /internal/tui/flamegraph/model.go
parent4953fd0200eef52f7e1547d5961a2e70e24e49d1 (diff)
Add flamegraph benchmark suite and reuse hot-path buffers
Diffstat (limited to 'internal/tui/flamegraph/model.go')
-rw-r--r--internal/tui/flamegraph/model.go6
1 files changed, 3 insertions, 3 deletions
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() {