1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OpenJ9 を試す

Posted at

OpenJ9 とか言うものが Java 9 と同時にリリースされてたのでちょっと気になってた。
トップページに以下のような文言が。

Boost your Java application performance

Low memory footprint. Fast start-up time. High application throughput.
Optimized to run Java applications cost-effectively in the cloud.
Want an OpenJDK build that contains an enterprise grade, open source, Java virtual machine?
Grab a pre-built binary and try it for yourself...

処理が早いのか?JVMより起動が早いのか?メモリ使用量が少ないのか?
などなど気になりますが、とりあえず処理速度の面で見てみます。

免責

仕事の息抜きにスーパー雑にやっただけなので、ちゃんとした詳細なベンチは他の方のを御覧ください。

環境

コード

test.java
import java.math.*;

public class test {
    final static int LOOP_COUNT = 1_000_000_000;
    public static void main(String[] args) {
        BigInteger bi = BigInteger.ZERO;
        for(int i = 0; i < LOOP_COUNT; i++) {
            BigInteger _bi = BigInteger.valueOf(i);
            bi = bi.add(_bi);
        }
        System.out.println(bi);
    }
}

10億回ループして足すだけの目も当てられない雑なコード。

計測方法

javac test.java
time java test

雑な計測。

結果

JDK8

$ time java test
499999999500000000

real	0m31.215s
user	0m22.668s
sys	0m7.332s

JDK9

$ time java test
499999999500000000

real	0m24.734s
user	0m18.532s
sys	0m4.936s

JDK9 + OpenJ9

$ time java test
499999999500000000

real	0m54.416s
user	0m48.192s
sys	0m4.500s

「あれ、なんか間違えたかな…」って気分になりました。

メモリ使用量は Minecraft の JVM として使ってみると実感できるかも?(適当)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?