Nastel/cybench-java-benchmarks

JSON benchmark for Boon fails on Java 9+

kausandr opened this issue · 0 comments

Boon lib fails to initialize when running on Java versions 9+. It throws an exception:

java.lang.ExceptionInInitializerError
        at org.boon.json.JsonMappingParser.<init>(JsonMappingParser.java:85)
        at org.boon.json.JsonParserFactory.create(JsonParserFactory.java:228)
        at org.boon.json.implementation.ObjectMapperImpl.readValue(ObjectMapperImpl.java:67)
        at com.gocypher.cybench.jmh.jvm.client.tests.JsonLibraryBenchmark$BoonDeserialize.doJob(JsonLibraryBenchmark.java:779)
        at com.gocypher.cybench.jmh.jvm.client.tests.JsonLibraryBenchmark.boonWithAverageJSON(JsonLibraryBenchmark.java:357)
        at com.gocypher.cybench.jmh.jvm.client.tests.jmh_generated.JsonLibraryBenchmark_boonWithAverageJSON_jmhTest.boonWithAverageJSON_thrpt_jmhStub(JsonLibraryBenchmark_boonWithAverageJSON_jmhTest.java:179)
        at com.gocypher.cybench.jmh.jvm.client.tests.jmh_generated.JsonLibraryBenchmark_boonWithAverageJSON_jmhTest.boonWithAverageJSON_Throughput(JsonLibraryBenchmark_boonWithAverageJSON_jmhTest.java:111)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:453)
        at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:437)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')
        at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)
        at org.boon.core.reflection.FastStringUtils.toCharArray(FastStringUtils.java:175)
        at org.boon.primitive.Chr.chars(Chr.java:70)
        at org.boon.json.implementation.JsonParserCharArray.<clinit>(JsonParserCharArray.java:275)
        ... 19 more

See Boon open issue.

It may be some other libs not supporting Java 9+ and already being unsupported for a long time. Last Boon release and commit dates back to 2016.

So some benchmarks may be dependent on runner JVM version: e.g Boon benchmarks run only if runner Java is 1.8.