风一更--软件开发--Java--JMH 微基准测试
目的:使用JMH 对 Java 并行计算科学测试. 2023-02-13
1.依赖
2.IDEA 设置
感谢参考:
1.CSDN 博文: https://blog.csdn.net/LiushaoMr/article/details/107729539
1. 依赖
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.36</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.36</version>
<scope>test</scope>
</dependency>
2.IDEA
JMH Plugin
由于用到了注解,运行程序注解配置
setting -> Build,Execution,deployment -> Complier -> Annotation Processors -> Enable annotation processing 勾上
3. 测试类要在 test package 下面
4. 如果报错: trying to acquire the JMH lock c:\windows\/jmh.lock 拒绝访问.
RunConfiguration -> Environment Variables -> include system environment viables

浙公网安备 33010602011771号