Skip to content

test: add focused render microbenchmarks#2

Open
cweill wants to merge 1 commit into
mainfrom
bench/focused-render-microbenchmarks
Open

test: add focused render microbenchmarks#2
cweill wants to merge 1 commit into
mainfrom
bench/focused-render-microbenchmarks

Conversation

@cweill

@cweill cweill commented Apr 4, 2026

Copy link
Copy Markdown

Summary

  • add focused RenderBuffer microbenchmarks for changed vs no-op SetCell
  • add focused RenderBuffer area-op microbenchmarks for full vs partial Fill/Clear
  • add focused TerminalScreen and StyledString.Draw microbenchmarks to compare hot paths on ScreenBuffer and TerminalScreen

Verification

  • go test ./...
  • go test -run '^$' -bench 'Benchmark(RenderBufferSetCell|RenderBufferAreaOps|TerminalScreenSetCell|TerminalScreenRenderSparseUpdates|StyledStringDrawScreenBuffer|StyledStringDrawVariants)$' -benchmem ./

Latest Local Benchmarks

  • BenchmarkRenderBufferSetCell/changed: 12.93 ns/op
  • BenchmarkRenderBufferSetCell/noop: 13.32 ns/op
  • BenchmarkRenderBufferAreaOps/fill/full: 8330 ns/op
  • BenchmarkRenderBufferAreaOps/fill/partial: 851.6 ns/op
  • BenchmarkRenderBufferAreaOps/clear/full: 8257 ns/op
  • BenchmarkRenderBufferAreaOps/clear/partial: 750.5 ns/op
  • BenchmarkTerminalScreenSetCell/changed: 16.69 ns/op
  • BenchmarkTerminalScreenSetCell/noop: 16.64 ns/op
  • BenchmarkTerminalScreenRenderSparseUpdates: 23056 ns/op, 5124 B/op, 180 allocs/op
  • BenchmarkStyledStringDrawScreenBuffer: 30889 ns/op, 128 B/op, 2 allocs/op
  • BenchmarkStyledStringDrawVariants/screenbuffer/plain: 34023 ns/op, 130 B/op, 2 allocs/op
  • BenchmarkStyledStringDrawVariants/screenbuffer/ansi: 31192 ns/op, 130 B/op, 2 allocs/op
  • BenchmarkStyledStringDrawVariants/terminalscreen/plain: 48268 ns/op, 112 B/op, 1 allocs/op
  • BenchmarkStyledStringDrawVariants/terminalscreen/ansi: 49148 ns/op, 117 B/op, 1 allocs/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant