@ 261105.1 · fetching

261003.1 · 5a6c8bf183d1fc9605da90128c4e603d41dc44a8

perf(cell): fill areas without an allocation per cell

reading declarations

Changes to cell_bench_test.go. All files

cell_bench_test.go

@@ -81,3 +81,16 @@ func BenchmarkCellBufferPutChangedASCII(b *testing.B) { 		} 	} }++// BenchmarkCellBufferFillArea measures filling a whole screen, as clearing+// the background of a window does.+func BenchmarkCellBufferFillArea(b *testing.B) {+	cb := &CellBuffer{}+	cb.Resize(200, 50)+	style := StyleDefault.Background(ColorRed)+	b.ReportAllocs()+	b.ResetTimer()+	for i := 0; i < b.N; i++ {+		cb.FillArea(0, 0, 200, 50, ' ', style)+	}+}