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
import org.junit.Rule; | |
import org.junit.Test; | |
import org.neo4j.graphdb.DependencyResolver; | |
import org.neo4j.graphdb.RelationshipType; | |
import org.neo4j.graphdb.factory.GraphDatabaseFactory; | |
import org.neo4j.kernel.GraphDatabaseAPI; | |
import org.neo4j.kernel.impl.nioneo.store.NeoStore; | |
import org.neo4j.kernel.impl.nioneo.store.NodeRecord; | |
import org.neo4j.kernel.impl.nioneo.store.NodeStore; |
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
shipilev:stormpot-benchmark[master*]$ uname -a | |
Darwin shipilev.local 13.0.2 Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64 x86_64 | |
shipilev:stormpot-benchmark[master*]$ java -version | |
java version "1.7.0_51" | |
Java(TM) SE Runtime Environment (build 1.7.0_51-b13) | |
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) | |
shipilev:stormpot-benchmark[master*]$ | |
[ 1 thread ] | |
shipilev:stormpot-benchmark[master*]$ java -jar target/object-pool-benchmarks.jar ".*ClaimRelease.*" -t 1 -i 6 -wi 6 -f 1 -tu s -bm thrpt |
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
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
import org.junit.Rule; | |
import org.junit.Test; |
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
shipilev:object-pool-benchmarks[stormpot-2.2]$ ### Conditional CAS and lazySet: | |
shipilev:object-pool-benchmarks[stormpot-2.2]$ java -jar target/object-pool-benchmarks.jar ".*ClaimRelease.StormpotBlaze.*" -t 8 -tu ms -bm thrpt | |
# Run progress: 0.00% complete, ETA 00:06:40 | |
# VM invoker: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java | |
# VM options: <none> | |
# Fork: 1 of 10 | |
# Warmup: 20 iterations, 1 s each | |
# Measurement: 20 iterations, 1 s each | |
# Threads: 8 threads, will synchronize iterations | |
# Benchmark mode: Throughput, ops/time |
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
mvn clean package && java -jar target/object-pool-benchmarks.jar ".*ClaimRelease.StormpotBlaze.*" -t 8 -tu ms -bm thrpt -f 3 | |
branch: | |
Benchmark Mode Samples Mean Mean error Units | |
master: | |
o.s.ClaimRelease.StormpotBlazePool.cycle thrpt 60 255582.217 2739.712 ops/ms | |
perf/extend-atomicint: |
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
import java.util.concurrent.SynchronousQueue; | |
import org.openjdk.jmh.annotations.GenerateMicroBenchmark; | |
import org.openjdk.jmh.annotations.Group; | |
import org.openjdk.jmh.annotations.GroupThreads; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.Setup; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.logic.Control; |
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
var Functor = ['map']; | |
var Applicative = ['maps', 'wrap'].concat(Functor); | |
var Monad = ['mapcat'].concat(Applicative); | |
var compliment = function (f) { | |
return function (x) { | |
return !f(x); | |
} | |
} |
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) { | |
outer:for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) { | |
// Optimise the program by checking most likely candidates for | |
// coercion conflicts first. | |
boolean foundConflict = false; | |
for (int x = 1; x < 100; x++) { | |
// scala> for (x <- 1 until 15) | |
// yield ((x / 2) ^ (-1 * (x % 2))); | |
// res21: Seq[Int] = | |
// Vector(-1, 1, -2, 2, -3, 3, -4, 4, -5, 5, -6, 6, -7, 7) |
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
chris@Minty ~ $ perf stat -d echo 1 | |
1 | |
Performance counter stats for 'echo 1': | |
0.597512 task-clock # 0.249 CPUs utilized | |
3 context-switches # 0.005 M/sec | |
0 cpu-migrations # 0.000 K/sec | |
176 page-faults # 0.295 M/sec | |
<not supported> cycles |
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
import org.openjdk.jmh.annotations.Benchmark; | |
public class Finalizer | |
{ | |
private static class ObjectWithFinalizer | |
{ | |
@Override | |
protected void finalize() throws Throwable | |
{ | |
super.finalize(); |
OlderNewer