Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Support JMH for scala 2.12 #295 #463

wants to merge 2 commits into from

Conversation

dkomanov
Copy link
Contributor

Use reflection-based generator (RFGeneratorSource) instead of ASM-based, it does support Java8 byte-code.

Also version of JMH is upgraded.

Copy link
Contributor

@johnynek johnynek left a 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,
Copy link
Contributor

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")
Copy link
Contributor

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?

@johnynek
Copy link
Contributor

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 .bazelci/presubmit.yml

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.

@dkomanov
Copy link
Contributor Author

Closing in favor of #465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants