All Questions
8
questions
0
votes
0
answers
115
views
UseSuperWord turned off, and still getting vectorized code?
I am benchmarking some algorithms, wondering how much the JIT applies auto-vectorization. I set up a JMH project and am trying to turn auto-vectorization off.
The code snipped and the results can be ...
4
votes
1
answer
197
views
Why does running multiple lambdas in loops suddenly slow down?
Consider the following code:
public class Playground {
private static final int MAX = 100_000_000;
public static void main(String... args) {
execute(() -> {});
execute(() -...
3
votes
1
answer
231
views
JMH - why JIT does not eliminate my dead-code
I wrote two benchmarks to demonstrate that JIT can be a problem with writing fine benchmark (Please skip that I doesnt use @State here):
@Fork(value = 1)
@Warmup(iterations = 2, time = 10)
@...
13
votes
2
answers
2k
views
Is it possible to make java.lang.invoke.MethodHandle as fast as direct invokation?
I'm comparing performance of MethodHandle::invoke and direct static method invokation. Here is the static method:
public class IntSum {
public static int sum(int a, int b){
return a + b;
...
9
votes
1
answer
228
views
Comparing performance of Collectors.summingLong and Collectors.counting
Benchmarks are run under intel core i5, Ubuntu
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
I'm ...
8
votes
1
answer
486
views
JVM JIT method recalculate for pure methods
Benchmarking the following Java code using jmh:
interface MyInterface {
public int test(int i);
}
class A implements MyInterface {
public int test(int i) {
return (int)Math.sin(Math....
-1
votes
1
answer
119
views
How is this JMH microbenchmark skewed, if it is?
The benchmark is quite simple:
@State(Scope.Benchmark)
public class MathPowVsRawMultiplyTest
{
private static final double VICTIM;
static {
VICTIM = new Random(System....
1
vote
2
answers
769
views
Why use JMH if you can switch off JIT?
I wonder why I should use JMH for benchmarking if I can switch off JIT?
Is JMH not suppressing optimizations which can be prevented by disabling JIT?