在macos yosemite上编译openjdk9

wiki 上查看不同系统的支持状况

  1. 安装xquartz
  2. 安装freetype: brew install freetype
  3. 要有oracle jdk8以上, 如果configure时候找不到, 需要
  4. 跟官网介绍,我编译的是dev的 fastdebug版本

    hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk9
    cd ./jdk9
    ./get_source.sh (This will take sometime to download the sources so be patient. May be few hours sometimes)
    ./configure –enable-debug –with-target-bits=64

测试xcode7下也可以编译成功

ref:

wiki
building-openjdk-9-on-a-osx-or-any-linux
http://quinn-zhuang.iteye.com/blog/2177397
http://my.oschina.net/u/1043802/blog/466423
https://github.com/hgomez/obuildfactory/wiki/Building-and-Packaging-OpenJDK9-for-OSX

Display_Text

使用hsdis

http://kenai.com/projects/base-hsdis

http://antoniogoncalves.org/2015/01/15/micro-benchmarking-with-jmh-measure-dont-guess/

http://coolshell.cn/articles/11454.html

http://daniel.mitterdorfer.name/articles/2014/benchmarking-hello-jmh/
http://psy-lob-saw.blogspot.jp/2013/05/using-jmh-to-benchmark-multi-threaded.html
https://github.com/rednaxelafx?tab=repositories
http://daringfireball.net/projects/markdown/syntax#code

netty5 相比netty4的改动:

  1. 采用EventExecutor取代 Thread绑定
    1
    2
    3
    io.netty.util.concurrent.SingleThreadEventExecutor
    => public void execute(Runnable task)
    => startThread 改成 startExecution

基准测试jmh

http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/

mvn clean install
java -jar target/benchmarks.jar JMHSample_01`
(4)main方法里头运行
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(JMHSample_01_HelloWorld.class.getSimpleName())
.forks(1)
.build();
new Runner(opt).run();
}
三、参数说明
1、Mode.Throughput
在有时限的迭代里头,该方法能被调用多少次

2、Mode.AverageTime
方法平均执行时间

3、Mode.SampleTime
对方法执行时间进行采样计算

4、Mode.SingleShotTime
方法的单次调用时间/一次批处理的总调用时间

注意点:
从@State对象读取测试输入并返回计算的结果,方便JMH对冗余代码进行消除;
如果是测试方法的性能,则避免通过在方法内循环(重复执行方法内原来代码),这样造成方法方法调用次数的减少,结果不准确,应该把循环调用放在方法外头。

http://ou.zhencong.me/技术记录/java-microbenchmark-harness.html
http://daniel.mitterdorfer.name/articles/2014/benchmarking-hello-jmh/
深入了解LongAdder(英文)
使用JMH对多线程代码进行基准测试(英文)
使用JMH对多线程代码进行基准测试(英文)