Skip to content

test: use b.Loop in Tea run benchmark - #1783

Open
daixiheguu wants to merge 1 commit into
charmbracelet:mainfrom
daixiheguu:test-modernize-benchmark-loop
Open

test: use b.Loop in Tea run benchmark#1783
daixiheguu wants to merge 1 commit into
charmbracelet:mainfrom
daixiheguu:test-modernize-benchmark-loop

Conversation

@daixiheguu

@daixiheguu daixiheguu commented Aug 27, 2026

Copy link
Copy Markdown
  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

B.Loop intentionally defeats compiler optimizations such as inlining so that the benchmark is not entirely optimized away. Currently, however, it may cause benchmarks to become slower in some cases due to increased allocation; see https://go.dev/issue/73137.

Update BenchmarkTeaRun to use testing.B.Loop instead of manually iterating over b.N.

The benchmark setup and measured p.Run() operation are unchanged; this only adopts the current Go benchmark-loop API.

Tested with go test ..

Signed-off-by: daixiheguu <daixihegu@outlook.com>
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