如何在Java中编写正确的微基准测试?

只愿长相守 提交于 2020-04-21 04:54:00

问题:

How do you write (and run) a correct micro-benchmark in Java? 您如何用Java编写(并运行)正确的微基准测试?

I'm looking for some code samples and comments illustrating various things to think about. 我正在寻找一些代码示例和注释,以说明要考虑的各种问题。

Example: Should the benchmark measure time/iteration or iterations/time, and why? 示例:基准测试应测量时间/迭代或迭代/时间,为什么?

Related: Is stopwatch benchmarking acceptable? 相关: 秒表基准测试是否可以接受?


解决方案:

参考一: https://stackoom.com/question/278h/如何在Java中编写正确的微基准测试
参考二: https://oldbug.net/q/278h/How-do-I-write-a-correct-micro-benchmark-in-Java
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!