我正在使用 Google Caliper(最新的主代码)对二维的四段代码进行基准测试。例如,以下基准测试方法:
@Benchmark mechanismOneBreadth(...)
@Benchmark mechanismOneDepth(...)
@Benchmark mechanismTwoBreadth(...)
@Benchmark mechanismTwoDepth(...)
我想做的是用一些额外的维度来注释每个基准,以便在结果应用程序上显示/操作,这样我就可以比较一个深度和一个宽度,也可以比较一个深度和两个深度和一个宽度有两个宽度。例如:
@Benchmark @Dimensions({"one", "breadth"}) mechanismOneBreadth(...)
@Benchmark @Dimensions({"one", "depth"}) mechanismOneDepth(...)
@Benchmark @Dimensions({"two", "breadth"}) mechanismTwoBreadth(...)
@Benchmark @Dimensions({"two", "depth"}) mechanismTwoDepth(...)
指定的尺寸与在 UI 上显示的参数非常相似,但我不能使用参数,因为在每种情况下调用的代码都不同。有没有办法用当前版本的 Caliper 做到这一点?