JMH Unable to find the resource: /META-INF/BenchmarkList

Finally found it out. There was a problem with missing exec-maven-plugin plugin <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>run-benchmarks</id> <phase>integration-test</phase> <goals> <goal>exec</goal> </goals> <configuration> <classpathScope>test</classpathScope> <executable>java</executable> <arguments> <argument>-classpath</argument> <classpath /> <argument>org.openjdk.jmh.Main</argument> <argument>.*</argument> </arguments> </configuration> </execution> </executions> </plugin>

Consuming stack traces noticeably slower in Java 11 than Java 8

I investigated the issue with async-profiler which can draw cool flame graphs demonstrating where the CPU time is spent. As @AlekseyShipilev pointed out, the slowdown between JDK 8 and JDK 9 is mainly the result of StackWalker changes. Also G1 has become the default GC since JDK 9. If we explicitly set -XX:+UseParallelGC (default in … Read more

Mystifying microbenchmark result for stream API on Java 12 vs. Java 8 with -gc true

Thanks, everyone for the help and especially to @Aleksey Shipilev! After applied changes to JMH benchmark, the results look more realistic (?) Changes: Change the setup method to be executed before/after each iteration of the benchmark. @Setup(Level.Invocation) -> @Setup(Level.Iteration) Stop JMH forcing GC between iterations. Forcing Full GC before each iteration is quite likely to … Read more

Java 8 stream unpredictable performance drop with no obvious reason

This effect is caused by Type Profile Pollution. Let me explain on a simplified benchmark: @State(Scope.Benchmark) public class Streams { @Param({“500”, “520”}) int iterations; @Setup public void init() { for (int i = 0; i < iterations; i++) { Stream.empty().reduce((x, y) -> x); } } @Benchmark public long loop() { return Stream.empty().count(); } } Though … Read more

Why is StringBuilder#append(int) faster in Java 7 than in Java 8?

TL;DR: Side effects in append apparently break StringConcat optimizations. Very good analysis in the original question and updates! For completeness, below are a few missing steps: See through the -XX:+PrintInlining for both 7u55 and 8u5. In 7u55, you will see something like this: @ 16 org.sample.IntStr::inlineSideEffect (25 bytes) force inline by CompilerOracle @ 4 java.lang.StringBuilder::<init> … Read more

Why is returning a Java object reference so much slower than returning a primitive

TL;DR: You should not put BLIND trust into anything. First things first: it is important to verify the experimental data before jumping to the conclusions from them. Just claiming something is 3x faster/slower is odd, because you really need to follow up on the reason for the performance difference, not just trust the numbers. This … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)