前言
看了RoaringBitmap的论文,其中提到的测试数据想自己跑一遍。这篇文章记录了我看RoaringBitmap的JMH基准测试的过程。对于基准测试不懂的同学可以看这里:JMH。
源码地址:https://github.com.cnpmjs.org/RoaringBitmap/RoaringBitmap.git
先让代码跑起来
1 文件中的文件分隔符
在window下这个文件分隔符就不对了,大佬都是用苹果或者linux系统开发的嘛?
Illegal character in path at index 10: file:///xxx\xxx\RoaringBitmap\build/repos/localDebug
repositories {
maven {
name = "localDebug"
url = URI.create("file:///${project.buildDir}/repos/localDebug")
}
}
Solution
在windows文件路径得是这种格式:file://D:/path/to/local/directory
2 运行jar文件时,WARNING
[xxx@xxx]# java -jar benchmarks.jar true -wi 5 -i 5 -f 1 $@
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/roaring/benchmarks.jar) to field java.io.Console.cs
WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
No matching benchmarks. Miss-spelled regexp?
Use EXTRA verbose mode to debug the pattern matching.
Causes
These warnings occur when using Groovy 2.x with Java 11 but are fixed in Groovy 3.
Solution
These messages can be safely ignored because they do not impact the use or functionality of ForgeRock products. However, if you do not want to see them, you can do one of the following:
- Use Groovy 3.x.
- Whitelist these warnings.
- Downgrade Java to JDK 1.8
换成jdk1.8之后
3 Error: Unable to access jarfile
Error: Unable to access jarfile benchmarks.jar
Solution
jar路径出错,或者没有写.jar后缀时,会出现这个错
4 参数说明
java -jar benchmarks.jar true -wi 5 -i 5 -f 1 $@
- true ??
- -wi 预热次数
- -i 迭代次数
- -f fork次数
- $@ ??