google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.3k stars 209 forks source link

starlark: add parameter to bench_xyz(b) benchmark functions #323

Closed alandonovan closed 3 years ago

alandonovan commented 3 years ago

The parameter is a wrapper around a testing.B, that provides the number of iterations and start/stop/reset methods. It follows the design used in java.starlark.net; see https://github.com/bazelbuild/starlark/pull/75#pullrequestreview-275604129 https://github.com/bazelbuild/bazel/commit/146cd2cecae52ebad6664046fd1430c2a23b55e1