RoaringBitmap源码分析-JMH基准测试详解

前言

看了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次数
  • $@ ??

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一本郑经

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值