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

Function BenchmarkRender_SmallLog

internal/tui/log_perf_test.go:493–509  ·  view source on GitHub ↗

--- Benchmark ---

(b *testing.B)

Source from the content-addressed store, hash-verified

491// --- Benchmark ---
492
493func BenchmarkRender_SmallLog(b *testing.B) {
494 lv := NewLogViewer()
495 lv.SetSize(120, 40)
496
497 for i := 0; i < 10; i++ {
498 lv.AddEvent(makeToolStartEvent("Read", map[string]interface{}{
499 "file_path": fmt.Sprintf("/file%d.go", i),
500 }))
501 lv.AddEvent(makeToolResultEvent(fmt.Sprintf("content of file %d", i)))
502 }
503 lv.ScrollToTop()
504
505 b.ResetTimer()
506 for i := 0; i < b.N; i++ {
507 lv.Render()
508 }
509}
510
511func BenchmarkRender_LargeLog(b *testing.B) {
512 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