-
-
Notifications
You must be signed in to change notification settings - Fork 286
Support JMH for scala 2.12 #295 #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just make reflection the only way it works?
) | ||
System.exit(1) | ||
} | ||
val fs = FileSystems.getDefault | ||
|
||
BenchmarkGeneratorArgs( | ||
fs.getPath(argv(0)), | ||
if ("asm".equalsIgnoreCase(argv(0))) AsmGenerator else ReflectionGenerator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we error if it is not asm or reflection?
case _: ArrayIndexOutOfBoundsException => | ||
// this would fail due to https://github.com/bazelbuild/rules_scala/issues/295 | ||
// let's throw a useful message instead | ||
sys.error("jmh in rules_scala doesn't work with Java 8 bytecode: https://github.com/bazelbuild/rules_scala/issues/295") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change the error to say asm mode does not work with java 8 bytecode and instead suggest using reflection?
Thank you so much for tackling this! This will be a big help. I think the 2.12 branch is a bit out of date sadly. For instance, I think it may have an out of date Can you make this as a PR against master and then we can cherry-pick it and re-enable the jmh test? If you do this, we can probably merge very quickly. |
Closing in favor of #465 |
Use reflection-based generator (RFGeneratorSource) instead of ASM-based, it does support Java8 byte-code.
Also version of JMH is upgraded.