MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / BenchmarkRender_LargeLog

Function BenchmarkRender_LargeLog

internal/tui/log_perf_test.go:511–528  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

509}
510
511func BenchmarkRender_LargeLog(b *testing.B) {
512 lv := NewLogViewer()
513 lv.SetSize(120, 40) // viewport of 40 lines
514
515 // 1000 entries - simulates a long session
516 for i := 0; i < 1000; i++ {
517 lv.AddEvent(makeToolStartEvent("Bash", map[string]interface{}{
518 "command": fmt.Sprintf("command-%d", i),
519 }))
520 lv.AddEvent(makeToolResultEvent(fmt.Sprintf("output line %d", i)))
521 }
522 lv.ScrollToTop()
523
524 b.ResetTimer()
525 for i := 0; i < b.N; i++ {
526 lv.Render()
527 }
528}
529
530func BenchmarkRender_LargeLogWithHighlighting(b *testing.B) {
531 lv := NewLogViewer()

Callers

nothing calls this directly

Calls 7

SetSizeMethod · 0.95
AddEventMethod · 0.95
ScrollToTopMethod · 0.95
RenderMethod · 0.95
NewLogViewerFunction · 0.85
makeToolStartEventFunction · 0.85
makeToolResultEventFunction · 0.85

Tested by

no test coverage detected