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 org.openjdk; | |
import org.openjdk.jmh.annotations.*; | |
import org.openjdk.jmh.infra.Blackhole; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ThreadLocalRandom; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLongFieldUpdater; |
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 org.openjdk; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLongFieldUpdater; | |
import org.openjdk.jmh.annotations.*; | |
import org.openjdk.jmh.infra.Blackhole; | |
/** | |
* <code> |
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
@BenchmarkMode(Mode.AverageTime) | |
@Warmup(iterations = 5) | |
@Measurement(iterations = 5) | |
@Fork(3) | |
@OutputTimeUnit(TimeUnit.NANOSECONDS) | |
@State(Scope.Benchmark) | |
public class MyBenchmark { | |
private static class TestActor extends UntypedActor { | |
@Override |
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
This is a class: | |
class C { | |
final int v; | |
C(int v) { | |
this.v = v; | |
} | |
int sqr() { | |
return v*v; |
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
/***** BEGIN LICENSE BLOCK ***** | |
* Version: CPL 1.0/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Common Public | |
* License Version 1.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.eclipse.org/legal/cpl-v10.html | |
* | |
* Software distributed under the License is distributed on an "AS | |
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
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
$ wget -6 keys.gnupg.net | |
--2014-07-30 16:27:36-- http://keys.gnupg.net/ | |
Resolving keys.gnupg.net (keys.gnupg.net)... 2001:41d0:8:44d7::1:1, 2001:610:1108:5011::70, 2001:6f8:1c3c:babe::62:1, ... | |
Connecting to keys.gnupg.net (keys.gnupg.net)|2001:41d0:8:44d7::1:1|:80... connected. | |
HTTP request sent, awaiting response... 301 Moved Permanently | |
Location: http://www.adeti.org/ [following] | |
--2014-07-30 16:27:36-- http://www.adeti.org/ | |
Resolving www.adeti.org (www.adeti.org)... 2001:41d0:8:44d7::1:1, 91.121.41.109 | |
$ wget -4 keys.gnupg.net |
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
### Keybase proof | |
I hereby claim: | |
* I am shipilev on github. | |
* I am shipilev (https://keybase.io/shipilev) on keybase. | |
* I have a public key whose fingerprint is 0190 82BC 00E0 324E 2AEF 4CF0 0D3B 3285 62A1 19A7 | |
To claim this, I am signing this object: |
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
Benchmark code: | |
https://github.com/shipilev/article-exception-benchmarks | |
Prepare: | |
$ mvn clean install | |
Run: | |
$ java -jar target/microbenchmarks.jar ".*ThrowingStackless.*" -f 1 -wi 5 -i 5 -t ${THREADS} | |
On 2x12x2 Xeon, JDK 8 GA x86_64: |
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
$ acpitool -B | |
Battery #1 : present | |
Remaining capacity : 70810 mWh, 98.95%, 06:39:02 | |
Design capacity : 82620 mWh | |
Last full capacity : 71560 mWh, 86.61% of design capacity | |
Capacity loss : 13.39% | |
Present rate : 10647 mW | |
Charging state : Discharging | |
Battery type : Li-ion | |
Model number : 42T4710 |
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
$ bin/java -jar ~/projects/jol/jol-cli/target/jol-internals.jar java.lang.String | |
Running 64-bit HotSpot VM. | |
Using compressed references with 3-bit shift. | |
Objects are 8 bytes aligned. | |
Field sizes by type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] | |
Array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] | |
java.lang.String object internals: | |
OFFSET SIZE TYPE DESCRIPTION VALUE | |
0 4 (object header) 01 00 00 00 (0000 0001 0000 0000 0000 0000 0000 0000) |