Skip to content

Instantly share code, notes, and snippets.

View shelajev's full-sized avatar

Oleg Šelajev shelajev

View GitHub Profile
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>org.graalvm.sdk</artifactId>
<version>1.0.0-rc13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<artifactId>svm</artifactId>
<version>1.0.0-rc13</version>
<scope>provided</scope>
</dependency>
ImageName = netty-plot
Args = --features=com.oracle.svm.nettyplot.PlotterSingletonFeature -H:+SpawnIsolates
ImageName = netty-plot
Args = --features=com.oracle.svm.nettyplot.PlotterSingletonFeature -H:+SpawnIsolates
ImageName = netty-plot
Args = --features=com.oracle.svm.nettyplot.PlotterSingletonFeature \
-H:ReflectionConfigurationResources=${.}/reflection-config.json \
--delay-class-initialization-to-runtime=io.netty.handler.codec.http.HttpObjectEncoder \
-H:+SpawnIsolates
<configuration>
<mainClass>com.acme.MeepMeep</mainClass>
<buildArgs>-ea</buildArgs>
</configuration>
...
[INFO] --- maven-assembly-plugin:3.1.0:single (assemble-all) @ netty-plot ---
[INFO] Building jar: /home/paul/OLabs/git/netty-native-demo/target/netty-plot-full-jar-with-dependencies.jar
[INFO]
[INFO] --- native-image-maven-plugin:1.0.0-rc8:native-image (default) @ netty-plot ---
[INFO] ImageClasspath Entry: io.netty:netty-all:jar:4.1.30.Final:compile (file:///home/paul/.m2/repository/io/netty/netty-all/4.1.30.Final/netty-all-4.1.30.Final.jar)
[INFO] ImageClasspath Entry: net.objecthunter:exp4j:jar:0.4.8:compile (file:///home/paul/.m2/repository/net/objecthunter/exp4j/0.4.8/exp4j-0.4.8.jar)
[INFO] ImageClasspath Entry: org.jfree:jfreesvg:jar:3.3:compile (file:///home/paul/.m2/repository/org/jfree/jfreesvg/3.3/jfreesvg-3.3.jar)
[INFO] ImageClasspath Entry: com.oracle.substratevm:netty-plot:jar:0.1 (file:///home/paul/OLabs/git/netty-native-demo/target/netty-plot-0.1.jar)
[INFO] Executing: /home/paul/OLabs/graalvm-ce-1.0.0-rc8/jre/bin/native-image -cp /home/paul/.m2/repository/io/netty/netty-all/4.1.30.Fina
<plugin>
<groupId>com.oracle.substratevm</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>1.0.0-rc13</version>
<executions>
<execution>
<goals>
<goal>native-image</goal>
</goals>
<phase>package</phase>
package org.example.pathtracer;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Random;
import static org.example.pathtracer.Vec.*;
# shelajev at dhcp-10-175-173-166.vpn.oracle.com in ~/repo/postcard_pathtracer [19:13:07]
→ clang -o card2 -O3 raytracer.cpp
# shelajev at dhcp-10-175-173-166.vpn.oracle.com in ~/repo/postcard_pathtracer [19:13:23]
→ time ./card2 > pixar.ppm
./card2 > pixar.ppm
195.15s user 1.35s system 97% cpu 3:21.85 total