This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Param; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.Setup; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.annotations.Threads; | |
import sun.misc.Unsafe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ASSERT = 0 | |
const int STACK_BIAS = 0 | |
const int oopSize = 8 | |
const int LogBytesPerWord = 3 | |
const int BytesPerWord = 8 | |
const int BytesPerLong = 8 | |
const int LogKlassAlignmentInBytes = 3 | |
const int ageTable::table_size = 16 | |
const int BarrierSet::ModRef = 0 | |
const int BarrierSet::CardTableModRef = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.State; | |
@State(Scope.Thread) | |
public class InliningBenchmark { | |
static volatile int value = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2014 Brett Wooldridge, Andrei Pangin | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lz4; | |
import static lz4.LZ4Common.*; | |
public class LZ4Array { | |
private static long getLong(byte[] b, int p) { | |
return (b[p] & 0xffL) | |
| (b[p + 1] & 0xffL) << 8 | |
| (b[p + 2] & 0xffL) << 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench; | |
import org.openjdk.jmh.annotations.*; | |
import java.util.*; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
@State(Scope.Benchmark) | |
public class ListIndexOf { | |
private static final Random random = new Random(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
long start = System.currentTimeMillis(); | |
for (;;) { | |
Thread.sleep(10); | |
System.out.println(System.currentTimeMillis() - start); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench; | |
import org.openjdk.jmh.annotations.*; | |
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.util.stream.IntStream; | |
@State(Scope.Benchmark) | |
public class ArrayGet { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench; | |
import org.openjdk.jmh.annotations.*; | |
import java.util.Random; | |
@State(Scope.Benchmark) | |
public class Blend { | |
int foreground = new Random(0).nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opcode length name | |
----------------------------- | |
0 1 nop | |
1 1 aconst_null | |
2 1 iconst_m1 | |
3 1 iconst_0 | |
4 1 iconst_1 | |
5 1 iconst_2 | |
6 1 iconst_3 | |
7 1 iconst_4 |
OlderNewer