This entry is for 12/3 of "Enterprise" hello, world "2018 Advent Calendar 2018". In this Advent Calendar, we plan to cover one topic with one entry as much as possible, considering the flow of the story that spans multiple entries.
The topics mentioned in this entry are "Determine specifications" and "Let's make an MVP (Minimum Viable Product)".
Please refer to the Enterprise hello, world 2018 site for refusal of the entire Advent Calendar.
The following situations are assumed as "Enterprise" hello, world "2018" material.
On Day 1, I got a feel for the old program that I had to migrate, so I have to work towards the transition. In order to realize it, we are determined to work according to the premise of EHW2018.
--Display the string "hello, world" in the user interface
That is all. Let's implement it.
Use OpenJDK 11.0.1. I will send it with Windows10 version 1803.
>C:\Java\jdk-11.0.1\bin\java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello, world");
}
}
In Java11 it was possible to execute ".java" files directly. Wow.
>C:\Java\jdk-11.0.1\bin\java HelloWorld.java
hello, world
Compile and run. Let's run it with the experimental function from JDK11, "Run without GC (Epsilon GC)".
>C:\Java\jdk-11.0.1\bin\java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc HelloWorld
[0.028s][info][gc] Resizeable heap; starting at 250M, max: 4011M, step: 128M
[0.030s][info][gc] Using TLAB allocation; max: 4096K
[0.033s][info][gc] Elastic TLABs enabled; elasticity: 1.10x
[0.035s][info][gc] Elastic TLABs decay enabled; decay time: 1000ms
[0.036s][info][gc] Using Epsilon
hello, world
[0.325s][info][gc] Total allocated: 881 KB
[0.325s][info][gc] Average allocation rate: 1391734 KB/sec
Running without GC is interesting in terms of trying the challenge path towards performance (eg Log4j's trial without garbage).
In this entry, as the third day of "Enterprise" hello, world "2018 Advent Calendar 2018" (EHW2018), I took up the topic of writing hello, world using Java 11 features as much as possible.
As for the story of EHW2018, it is expected that tomorrow around the infrastructure will head for the future.
Recommended Posts