Skip to content

Instantly share code, notes, and snippets.

View shipilev's full-sized avatar

Aleksey Shipilëv shipilev

View GitHub Profile
Entering generation 0
---------------------------------------
Baseline score: 663.60 ops/ms
678.53 ops/ms ( +2.25%) -XX:FreqInlineSize=325 -XX:InlineSmallCode=1000 -XX:MaxInlineLevel=9 -XX:MaxInlineSize=35 -XX:MaxRecursiveInlineLevel=1 -XX:MinInliningThreshold=250
676.79 ops/ms ( +1.99%) -XX:FreqInlineSize=325 -XX:InlineSmallCode=1000 -XX:MaxInlineLevel=9 -XX:MaxInlineSize=35 -XX:MaxRecursiveInlineLevel=1 -XX:MinInliningThreshold=250
673.78 ops/ms ( +1.53%) -XX:FreqInlineSize=325 -XX:InlineSmallCode=1000 -XX:MaxInlineLevel=9 -XX:MaxInlineSize=35 -XX:MaxRecursiveInlineLevel=1 -XX:MinInliningThreshold=250
673.55 ops/ms ( +1.50%) -XX:FreqInlineSize=325 -XX:InlineSmallCode=1000 -XX:MaxInlineLevel=9 -XX:MaxInlineSize=35 -XX:MaxRecursiveInlineLevel=1 -XX:MinInliningThreshold=250
670.98 ops/ms ( +1.11%) -XX:FreqInlineSize=325 -XX:InlineSmallCode=1000 -XX:MaxInlineLevel=9 -XX:MaxInlineSize=35 -XX:MaxRecursiveInlineLevel=1 -XX:MinInliningThreshold=250
670.82 ops/ms (
@shipilev
shipilev / IterationBenchmark.java
Last active August 29, 2015 13:57
Pop quiz: what's wrong with measureWrong()?
package org.sample;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
@shipilev
shipilev / IterationBenchmark.java
Created March 5, 2014 06:07
Dead code is so dead
package org.sample;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
@shipilev
shipilev / gist:9595796
Created March 17, 2014 08:33
Quad-core Cortex-A9, jcstress/UnfencedAcquireReleaseTest
$ jdk8b132/bin/java -server -XX:-RestrictContended -jar jcstress.jar -t ".*UnfencedAcquireReleaseTest.*" -v -f 0 -iters 1000
(ETA: n/a) (R: 5.82E+12) (T: 1/0) (F: 0/0) (I: 0/1000) [OK] o.o.j.t.fences.UnfencedAcquireReleaseTest
Observed state Occurrences Expectation Interpretation
[0, 0] ( 190,046,972) ACCEPTABLE Before observing releasing write to, any value is OK for ...
[0, 1] ( 234) ACCEPTABLE Before observing releasing write to, any value is OK for ...
[0, 2] ( 322) ACCEPTABLE Before observing releasing write to, any value is OK for ...
[0, 3] ( 178,121) ACCEPTABLE Before observing releasing write to, any value is OK for ...
[1, 0] ( 572) ACCEPTABLE_INTERESTING Without fence or volatile can read the default or old val...
# Run progress: 0.00% complete, ETA 00:00:05
# VM invoker: /home/shade/Install/jdk8u0/jre/bin/java
# VM options: <none>
# Fork: 1 of 1
# Warmup: <none>
# Measurement: 5 iterations, 1 s each
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: org.openjdk.jmh.samples.JMHSample_01_HelloWorld.wellHelloThere
Iteration 1: 1838576.986 ops/ms
@shipilev
shipilev / gist:10602166
Created April 13, 2014 21:01
o.o.j.t.fences.UnfencedAcquireReleaseTest
It looks like test is affected by where the guard variable is residing, this changeset isolates it:
http://hg.openjdk.java.net/code-tools/jcstress/rev/39a1c4786c47
On x86_64, it can not fail without compiler being involved, since x86 is TSO:
$ jdk8/bin/java -XX:-RestrictContended -jar tests-custom/target/jcstress.jar -t ".*UnfencedAcquireReleaseTest.*" -v -iters 20 -f 5
Observed state Occurrences Expectation Interpretation
[0, 0] ( 27,588,422) ACCEPTABLE Before observing releasing write to, any value is OK for ...
[0, 1] ( 167) ACCEPTABLE Before observing releasing write to, any value is OK for ...
/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you 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
@shipilev
shipilev / gist:11233952
Last active August 29, 2015 14:00
StringToUTF8 run
https://github.com/shipilev/benchmarks-scratch/blob/master/src/main/java/org/sample/StringToUTF8.java
It is always prudent to verify "sample" mode with "avgt", because timestamping overhead/accuracy
might skew the results in "sample".
Benchmark (length) Mode Samples Mean Mean error Units
o.s.StringToUTF8.getBytesViaWriter 1 avgt 5 1.301 0.198 us/op
o.s.StringToUTF8.getBytesViaWriter 10 avgt 5 1.287 0.048 us/op
o.s.StringToUTF8.getBytesViaWriter 100 avgt 5 1.605 0.240 us/op
o.s.StringToUTF8.getBytesViaWriter 1000 avgt 5 4.727 0.766 us/op
@shipilev
shipilev / gist:11340572
Last active August 29, 2015 14:00
P-D 920 internals
$ lspci
00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub (rev 81)
00:01.0 PCI bridge: Intel Corporation 82945G/GZ/P/PL PCI Express Root Port (rev 81)
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 01)
00:1c.2 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 3 (rev 01)
00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 (rev 01)
@shipilev
shipilev / gist:2fddb1d2943a4cbb6080
Created May 1, 2014 17:45
OpenJDK, JDK 8u20, SLOC counts
SLOC Directory SLOC-by-Language (Sorted)
3141572 jdk java=2218158,ansic=413685,xml=390872,cpp=87365,sh=17648,
objc=12653,awk=684,haskell=195,asm=157,cs=72,ruby=44,jsp=24,perl=12,csh=3
789362 hotspot cpp=521039,java=237280,xml=16275,ansic=9670,asm=2774,
sh=2324
273831 langtools java=271273,xml=1472,sh=1086
263726 jaxp java=263509,xml=217
249946 jaxws java=249735,xml=211
103587 corba java=103587
76713 nashorn java=75093,xml=1354,sh=266