Skip to content

Instantly share code, notes, and snippets.

View CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(hotspot)
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE \
-D_REENTRANT \
-DLINUX -DINCLUDE_SUFFIX_OS=_linux -DVM_LITTLE_ENDIAN \
-DTARGET_COMPILER_gcc \
-DAMD64 -DHOTSPOT_LIB_ARCH='amd64' -DINCLUDE_SUFFIX_CPU=_x86 -D_LP64 -DTARGET_ARCH_x86 \
-DCOMPILER1 -DCOMPILER2")
View CapturingLambda.java
package playground;
import org.openjdk.jmh.annotations.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@State(Scope.Benchmark)
View Main.java
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
public class Main {
volatile Object consumer;
View JavaStringBenchmark.java
package org.qwwdfsad.benchmarks;
import org.openjdk.jmh.annotations.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
/**
* @author Tolstopyatov Vsevolod
* @since 01/10/16
View ContainsBenchmark.kt
package org.qwwdfsad.benchmarks
import org.openjdk.jmh.annotations.*
import java.util.concurrent.TimeUnit
/**
* @author Tolstopyatov Vsevolod
* @since 29/09/16
*/
@Fork(value = 2) //jvmArgsAppend = arrayOf("-XX:TieredStopAtLevel=1"))
View java8.results
# Run complete. Total time: 00:04:12
Benchmark (power) Mode Cnt Score Error Units
PowBenchmark2.cross 2 avgt 5 3.318 ± 0.257 ns/op
PowBenchmark2.cross 3 avgt 5 3.929 ± 0.362 ns/op
PowBenchmark2.cross 4 avgt 5 5.105 ± 0.329 ns/op
PowBenchmark2.cross 5 avgt 5 6.392 ± 0.888 ns/op
PowBenchmark2.cross 6 avgt 5 6.109 ± 0.910 ns/op
PowBenchmark2.cross 7 avgt 5 6.497 ± 0.800 ns/op
PowBenchmark2.cross 8 avgt 5 6.791 ± 0.862 ns/op
View heapRegion.patch
diff --git a/src/share/vm/gc/g1/g1EvacFailure.cpp b/src/share/vm/gc/g1/g1EvacFailure.cpp
--- a/src/share/vm/gc/g1/g1EvacFailure.cpp
+++ b/src/share/vm/gc/g1/g1EvacFailure.cpp
@@ -216,14 +216,14 @@
}
bool doHeapRegion(HeapRegion *hr) {
- bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
- bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
-
@qwwdfsad
qwwdfsad / BitSetBenchmark.java
Last active May 10, 2016
BitSet vs OpenBitSet performance
View BitSetBenchmark.java
package ru.qwwdfsad.benchmarks;
import org.apache.lucene.util.OpenBitSet;
import org.openjdk.jmh.annotations.*;
import java.util.BitSet;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
@BenchmarkMode(Mode.Throughput)
View BitSetFillFactorBenchmark.java
package ru.qwwdfsad.benchmarks;
import org.apache.lucene.util.OpenBitSet;
import org.openjdk.jmh.annotations.*;
import java.util.BitSet;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
@BenchmarkMode(Mode.Throughput)
View inc.asm
Code:
[Entry Point]
[Constants]
# {method} {0x0000000125c23120} 'inc' '()V' in 'org/jctools/counters/FixedSizeStripedLongCounterV8'
# [sp+0x30] (sp of caller)
0x000000010c7de2a0: mov 0x8(%rsi),%r10d
0x000000010c7de2a4: shl $0x3,%r10
0x000000010c7de2a8: cmp %r10,%rax
0x000000010c7de2ab: jne 0x000000010c6e6e20 ; {runtime_call}
0x000000010c7de2b1: data32 xchg %ax,%ax