Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Groovy and GraalVM

Groovy and GraalVM

GraalVM is the new hot tool in the JVM ecosystem. It brings a bunch of new features, including creating native binaries from Java bytecode files to run startup programs without the overhead. It also applies to programs written in our favorite programming language - Groovy. In this quick intro, I will explain how to start compiling Groovy code to a native binary using GraalVM, what are the benefits and what kind of limitations we have to be aware of.

This presentation was prepared for GR8Conf EU 2019

Szymon Stępniak

May 28, 2019
Tweet

More Decks by Szymon Stępniak

Other Decks in Technology

Transcript

  1. Groovy and Groovy and Graal GraalVM VM TM TM Instant

    startup with native-image ahead-of-time compilation @wololock 
  2. 3 things you will 3 things you will learn learn

    today today how to use native-image command line tool 
  3. 3 things you will 3 things you will learn learn

    today today how to use native-image command line tool what are the Groovy limitations in terms of AOT  
  4. 3 things you will 3 things you will learn learn

    today today how to use native-image command line tool what are the Groovy limitations in terms of AOT when it makes sense to use native images   
  5. Hello, my name is Szymon Stepniak I blog @ Continuous

    Delivery Architect @ Torun Java User Group founder @wololock e.printstacktrace.blog  whoami whoami
  6. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $
  7. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl
  8. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $
  9. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version
  10. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212.buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $
  11. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212.buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $
  12. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212 .buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $
  13. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212 .buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $ gu install native-image
  14. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212 .buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $ gu install native-image $
  15. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212 .buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $ gu install native-image $ native-image --version
  16. ••• $ sdk install java 19.0.0-grl Done installing! Do you

    want java 19.0.0-grl to be set as default? (Y/n): n $ sdk use java 19.0.0-grl Using java version 19.0.0-grl in this shell. $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212 .buildslave.jdk8u-src-tar--b03) OpenJDK GraalVM CE 19.0.0 (build 25.212-b03-jvmci-19-b01, mixed mode) $ gu install native-image $ native-image --version GraalVM Version 19.0.0 CE $
  17. ••• $ groovy -version Groovy Version: 2.5.7 JVM: 1.8.0_212 Vendor:

    Oracle Corporation OS: Linux $ vim jobs.groovy
  18. ••• ~ ~ ~ ~ ~ ~ ~ ~ ~

    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  19. ••• import groovy.json.JsonSlurper def jobsUrl = "https://jobs.github.com/positions.json?description=groovy" def json =

    new JsonSlurper().parse(jobsUrl.toURL()) as List<Map> json.each { println ("\n" + "=" * 42) println it.title println it.location println "@ ${it.company}" println it.created_at println it.url println ("=" * 42) } ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  20. ••• import groovy.json.JsonSlurper def jobsUrl = "https://jobs.github.com/positions.json?description=groovy" def json =

    new JsonSlurper().parse(jobsUrl.toURL()) as List<Map> json.each { println ("\n" + "=" * 42) println it.title println it.location println "@ ${it.company}" println it.created_at println it.url println ("=" * 42) } ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  21. ••• import groovy.json.JsonSlurper def jobsUrl = "https://jobs.github.com/positions.json?description=groovy" def json =

    new JsonSlurper().parse(jobsUrl.toURL()) as List<Map> json.each { println ("\n" + "=" * 42) println it.title println it.location println "@ ${it.company}" println it.created_at println it.url println ("=" * 42) } ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  22. ••• import groovy.json.JsonSlurper def jobsUrl = "https://jobs.github.com/positions.json?description=groovy" def json =

    new JsonSlurper().parse(jobsUrl.toURL()) as List<Map> json.each { println ("\n" + "=" * 42) println it.title println it.location println "@ ${it.company}" println it.created_at println it.url println ("=" * 42) } ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  23. ••• import groovy.json.JsonSlurper def jobsUrl = "https://jobs.github.com/positions.json?description=groovy" def json =

    new JsonSlurper().parse(jobsUrl.toURL()) as List<Map> json.each { println ("\n" + "=" * 42) println it.title println it.location println "@ ${it.company}" println it.created_at println it.url println ("=" * 42) } ~ ~ ~ ~ ~ ~ jobs.groovy [New File]
  24. ••• $ time groovy jobs.groovy ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,744s user 0m2,594s sys 0m0,210s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  25. ••• $ time groovy jobs.groovy ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,744s user 0m2,594s sys 0m0,210s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  26. ••• $ time groovy jobs.groovy ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,744s ( ~700-800ms latency) user 0m2,594s sys 0m0,210s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  27. ••• ~ ~ ~ ~ ~ ~ ~ ~ ~

    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ compiler.groovy [New File]
  28. ••• $ vim compiler.groovy $ groovyc --configscript=compiler.groovy jobs.groovy $ ls

    -lah *.class -rw-rw-r-- 1 user user 2,6K 05-21 11:16 'jobs$_run_closure1.class' -rw-rw-r-- 1 user user 2,0K 05-21 11:16 jobs.class $
  29. ••• $ time java \ -cp ".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" \ jobs ...

    ========================================== Technical Lead, GitHub Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,395s user 0m1,336s sys 0m0,116s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  30. ••• $ time java \ -cp ".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" \ jobs ...

    ========================================== Technical Lead, GitHub Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,395s user 0m1,336s sys 0m0,116s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  31. ••• $ time java \ -cp ".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" \ jobs ...

    ========================================== Technical Lead, GitHub Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m1,395s vs. 0m1,744s user 0m1,336s sys 0m0,116s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  32. ••• $ export CPH=".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" $ native-image --no-server \ -cp "${CPH}"

    \ jobs [jobs:29582] classlist: 2,487.03 ms [jobs:29582] (cap): 1,007.37 ms [jobs:29582] setup: 2,110.49 ms [jobs:29582] analysis: 12,851.56 ms Warning: Aborting stand-alone image build. Unsupported features in 6 methods Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.codehaus.groovy.control.XStreamUtils.serialize(java.lang.String, java.la To diagnose the issue you can use the --allow-incomplete-classpath option. T ... [jobs:30355] image: 385.21 ms [jobs:30355] write: 108.26 ms [jobs:30355] [total]: 13,645.58 ms Warning: Image 'jobs' is a fallback image that requires a JDK for execution (use --no-fallback to suppress fallback image generation). $
  33. ••• $ export CPH=".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" $ native-image --no-server \ -cp "${CPH}"

    \ jobs [jobs:29582] classlist: 2,487.03 ms [jobs:29582] (cap): 1,007.37 ms [jobs:29582] setup: 2,110.49 ms [jobs:29582] analysis: 12,851.56 ms Warning: Aborting stand-alone image build. Unsupported features in 6 methods Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing : org.codehaus.groovy.control.XStreamUtils.serialize(java.lang.String, java.la To diagnose the issue you can use the --allow-incomplete-classpath option. T ... [jobs:30355] image: 385.21 ms [jobs:30355] write: 108.26 ms [jobs:30355] [total]: 13,645.58 ms Warning: Image 'jobs' is a fallback image that requires a JDK for execution (use --no-fallback to suppress fallback image generation). $
  34. ••• $ export CPH=".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" $ native-image --no-server \ -cp "${CPH}"

    \ jobs [jobs:29582] classlist: 2,487.03 ms [jobs:29582] (cap): 1,007.37 ms [jobs:29582] setup: 2,110.49 ms [jobs:29582] analysis: 12,851.56 ms Warning: Aborting stand-alone image build. Unsupported features in 6 methods Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing : org.codehaus.groovy.control.XStreamUtils.serialize(java.lang.String, java.la To diagnose the issue you can use the --allow-incomplete-classpath option. ... [jobs:30355] image: 385.21 ms [jobs:30355] write: 108.26 ms [jobs:30355] [total]: 13,645.58 ms Warning: Image 'jobs' is a fallback image that requires a JDK for execution (use --no-fallback to suppress fallback image generation). $
  35. ••• $ export CPH=".:$GROOVY_HOME/lib/groovy-2.5.7.jar:$GROOVY_HOME/lib/groovy-json-2.5.7.jar" $ native-image --no-server \ -cp "${CPH}"

    \ jobs [jobs:29582] classlist: 2,487.03 ms [jobs:29582] (cap): 1,007.37 ms [jobs:29582] setup: 2,110.49 ms [jobs:29582] analysis: 12,851.56 ms Warning: Aborting stand-alone image build. Unsupported features in 6 methods Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing : org.codehaus.groovy.control.XStreamUtils.serialize(java.lang.String, java.la To diagnose the issue you can use the --allow-incomplete-classpath option. ... [jobs:30355] image: 385.21 ms [jobs:30355] write: 108.26 ms [jobs:30355] [total]: 13,645.58 ms Warning: Image 'jobs' is a fallback image that requires a JDK for execution (use --no-fallback to suppress fallback image generation). $
  36. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ jobs [jobs:24147] classlist: 2,359.08 ms [jobs:24147] (cap): 817.77 ms [jobs:24147] setup: 1,907.15 ms [jobs:24147] analysis: 12,338.40 ms Error: Unsupported features in 3 methods Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass(String, byte[], int, in is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class To diagnose the issue, you can add the option --report-unsupported-elements- The unsupported element is then reported at run time when it is accessed the Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying Error: Image build request failed with exit status 1 $
  37. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ jobs [jobs:24147] classlist: 2,359.08 ms [jobs:24147] (cap): 817.77 ms [jobs:24147] setup: 1,907.15 ms [jobs:24147] analysis: 12,338.40 ms Error: Unsupported features in 3 methods Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass(String, byte[], int, in is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class To diagnose the issue, you can add the option --report-unsupported-elements- The unsupported element is then reported at run time when it is accessed the Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying Error: Image build request failed with exit status 1 $
  38. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ jobs [jobs:24147] classlist: 2,359.08 ms [jobs:24147] (cap): 817.77 ms [jobs:24147] setup: 1,907.15 ms [jobs:24147] analysis: 12,338.40 ms Error: Unsupported features in 3 methods Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass(String, byte[], int, in is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class To diagnose the issue, you can add the option --report-unsupported-elements- The unsupported element is then reported at run time when it is accessed the Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying Error: Image build request failed with exit status 1 $
  39. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ jobs
  40. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ jobs [jobs:4481] classlist: 2,456.28 ms [jobs:4481] (cap): 819.46 ms [jobs:4481] setup: 1,875.27 ms [jobs:4481] analysis: 32,853.15 ms Error: Unsupported features in 6 methods ... Error: type is not available in this platform: com.oracle.svm.core.locks.Cla Call path from entry point to java.lang.invoke.MethodType.makeImpl(Class, Cl no path found from entry point to target method Error: type is not available in this platform: org.graalvm.nativeimage.impl. Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying Error: Image build request failed with exit status 1 $
  41. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ jobs
  42. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ jobs
  43. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ jobs [jobs:18820] classlist: 2,376.13 ms [jobs:18820] (cap): 841.87 ms [jobs:18820] setup: 1,985.03 ms Warning: class initialization of class org.codehaus.groovy.control.XStreamUt failed with exception java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver. This class will be ini Warning: class initialization of class groovy.grape.GrapeIvy failed with exception java.lang.NoClassDefFoundError: org/apache/ivy/core/module/descriptor/DependencyDescriptor. This class will ... [jobs:18820] compile: 23,327.92 ms [jobs:18820] image: 2,009.68 ms [jobs:18820] write: 287.56 ms [jobs:18820] [total]: 54,147.88 ms $
  44. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ jobs [jobs:18820] classlist: 2,376.13 ms [jobs:18820] (cap): 841.87 ms [jobs:18820] setup: 1,985.03 ms Warning: class initialization of class org.codehaus.groovy.control.XStreamUt failed with exception java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver. This class will be ini Warning: class initialization of class groovy.grape.GrapeIvy failed with exception java.lang.NoClassDefFoundError: org/apache/ivy/core/module/descriptor/DependencyDescriptor. This class will ... [jobs:18820] compile: 23,327.92 ms [jobs:18820] image: 2,009.68 ms [jobs:18820] write: 287.56 ms [jobs:18820] [total]: 54,147.88 ms $
  45. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ jobs [jobs:18820] classlist: 2,376.13 ms [jobs:18820] (cap): 841.87 ms [jobs:18820] setup: 1,985.03 ms Warning: class initialization of class org.codehaus.groovy.control.XStreamUt failed with exception java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver. This class will be ini Warning: class initialization of class groovy.grape.GrapeIvy failed with exception java.lang.NoClassDefFoundError: org/apache/ivy/core/module/descriptor/DependencyDescriptor. This class will ... [jobs:18820] compile: 23,327.92 ms [jobs:18820] image: 2,009.68 ms [jobs:18820] write: 287.56 ms [jobs:18820] [total]: 54,147.88 ms $
  46. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ jobs
  47. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy jobs
  48. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time= org.codehaus.groovy.control.XStreamUtils ,groov jobs
  49. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils, groovy jobs
  50. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy jobs [jobs:30000] classlist: 2,528.44 ms [jobs:30000] (cap): 853.07 ms [jobs:30000] setup: 2,120.80 ms [jobs:30000] (typeflow): 9,920.70 ms ... [jobs:30000] (parse): 2,183.81 ms [jobs:30000] (inline): 3,536.05 ms [jobs:30000] (compile): 15,921.32 ms [jobs:30000] compile: 22,860.96 ms [jobs:30000] image: 1,967.39 ms [jobs:30000] write: 319.20 ms [jobs:30000] [total]: 54,349.57 ms $
  51. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy jobs [jobs:30000] classlist: 2,528.44 ms [jobs:30000] (cap): 853.07 ms [jobs:30000] setup: 2,120.80 ms [jobs:30000] (typeflow): 9,920.70 ms ... [jobs:30000] (parse): 2,183.81 ms [jobs:30000] (inline): 3,536.05 ms [jobs:30000] (compile): 15,921.32 ms [jobs:30000] compile: 22,860.96 ms [jobs:30000] image: 1,967.39 ms [jobs:30000] write: 319.20 ms [jobs:30000] [total]: 54,349.57 ms $
  52. ••• $ ls -lah jobs -rwxrwxr-x 1 user user 21M

    05-21 11:57 jobs $ ./jobs Exception in thread "main" groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class jobs. Reason: java.lang.InstantiationException: Type jobs can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image. at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $
  53. ••• $ ls -lah jobs -rwxrwxr-x 1 user user 21M

    05-21 11:57 jobs $ ./jobs Exception in thread "main" groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class jobs. Reason: java.lang.InstantiationException: Type jobs can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image. at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $
  54. ••• $ ls -lah jobs -rwxrwxr-x 1 user user 21M

    05-21 11:57 jobs $ ./jobs Exception in thread "main" groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class jobs. Reason: java.lang.InstantiationException: Type jobs can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image. at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $ vim reflections.json
  55. ••• ~ ~ ~ ~ ~ ~ ~ ~ ~

    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json [New File]
  56. ••• [ { "name": "jobs", "allDeclaredConstructors": true, "allPublicConstructors": true, "allDeclaredMethods":

    true, "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json [New File]
  57. ••• [ { "name": "jobs" , "allDeclaredConstructors": true, "allPublicConstructors": true,

    "allDeclaredMethods": true, "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json [New File]
  58. ••• [ { "name": "jobs", "allDeclaredConstructors": true , "allPublicConstructors": true

    , "allDeclaredMethods": true , "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json [New File]
  59. ••• [ { "name": "jobs", "allDeclaredConstructors": true, "allPublicConstructors": true, "allDeclaredMethods":

    true, "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json [New File]
  60. ••• $ ls -lah jobs -rwxrwxr-x 1 user user 21M

    05-21 11:57 jobs $ ./jobs Exception in thread "main" groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class jobs. Reason: java.lang.InstantiationException: Type jobs can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image. at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $ vim reflections.json $
  61. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy jobs
  62. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy jobs
  63. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles= jobs
  64. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json jobs
  65. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ jobs
  66. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ jobs [jobs:20954] classlist: 2,489.86 ms [jobs:20954] (cap): 843.23 ms [jobs:20954] setup: 1,916.73 ms [jobs:20954] (typeflow): 10,885.57 ms ... [jobs:20954] (compile): 14,667.84 ms [jobs:20954] compile: 21,032.08 ms [jobs:20954] image: 1,966.47 ms [jobs:20954] write: 294.49 ms [jobs:20954] [total]: 53,243.92 ms $
  67. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ jobs [jobs:20954] classlist: 2,489.86 ms [jobs:20954] (cap): 843.23 ms [jobs:20954] setup: 1,916.73 ms [jobs:20954] (typeflow): 10,885.57 ms ... [jobs:20954] (compile): 14,667.84 ms [jobs:20954] compile: 21,032.08 ms [jobs:20954] image: 1,966.47 ms [jobs:20954] write: 294.49 ms [jobs:20954] [total]: 53,243.92 ms $
  68. ••• $ ./jobs Exception in thread "main" org.codehaus.groovy.runtime.InvokerInvocationExce com.oracle.svm.core.jdk.UnsupportedFeatureError: Accessing

    an URL protocol that was not enabled. The URL protocol https is supported but not enabled by default. It must be enabled by adding the -H:EnableURLProtocols=https option to the native-image command. at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.j at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(Invoke at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $
  69. ••• $ ./jobs Exception in thread "main" org.codehaus.groovy.runtime.InvokerInvocationExce com.oracle.svm.core.jdk.UnsupportedFeatureError: Accessing

    an URL protocol that was not enabled. The URL protocol https is supported but not enabled by default. It must be enabled by adding the -H:EnableURLProtocols=https option to the native-image command. at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.j at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(Invoke at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHel at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper at jobs.main(jobs.groovy) $
  70. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ jobs
  71. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs
  72. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs [jobs:9386] classlist: 2,433.79 ms [jobs:9386] (cap): 855.86 ms [jobs:9386] setup: 2,115.01 ms [jobs:9386] (typeflow): 13,953.49 ms ... [jobs:9386] (compile): 30,385.07 ms [jobs:9386] compile: 39,845.02 ms [jobs:9386] image: 3,220.12 ms [jobs:9386] write: 385.24 ms [jobs:9386] [total]: 84,653.80 ms $
  73. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs [jobs:9386] classlist: 2,433.79 ms [jobs:9386] (cap): 855.86 ms [jobs:9386] setup: 2,115.01 ms [jobs:9386] (typeflow): 13,953.49 ms ... [jobs:9386] (compile): 30,385.07 ms [jobs:9386] compile: 39,845.02 ms [jobs:9386] image: 3,220.12 ms [jobs:9386] write: 385.24 ms [jobs:9386] [total]: 84,653.80 ms $
  74. ••• $ ./jobs WARNING: The sunec native library, required by

    the SunEC provider, could not be loaded. This library is usually shipped as part of the JDK and can be found under <JAVA_HOME>/jre/lib/<platform>/libsunec.so. It is loaded at run time via System.loadLibrary("sunec"), the first time services from SunEC are accessed. To use this providers services the java.library.pat system property needs to be set accordingly to point to a location that cont libsunec.so. Note that if java.library.path is not set it defaults to the current working directory. Exception in thread "main" org.codehaus.groovy.runtime.InvokerInvocationExce java.lang.UnsatisfiedLinkError: sun.security.ec.ECKeyPairGenerator.generateE [symbol: Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair or Java_s $
  75. ••• $ ./jobs WARNING: The sunec native library, required by

    the SunEC provider, could not be loaded. This library is usually shipped as part of the JDK and can be found under <JAVA_HOME>/jre/lib/<platform>/libsunec.so. It is loaded at run time via System.loadLibrary("sunec"), the first time services from SunEC are accessed. To use this providers services the java.library.pat system property needs to be set accordingly to point to a location that cont libsunec.so . Note that if java.library.path is not set it defaults to the current working directory. Exception in thread "main" org.codehaus.groovy.runtime.InvokerInvocationExce java.lang.UnsatisfiedLinkError: sun.security.ec.ECKeyPairGenerator.generateE [symbol: Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair or Java_s $
  76. ••• $ ./jobs WARNING: The sunec native library, required by

    the SunEC provider, could not be loaded. This library is usually shipped as part of the JDK and can be found under <JAVA_HOME>/jre/lib/<platform>/libsunec.so. It is loaded at run time via System.loadLibrary("sunec"), the first time services from SunEC are accessed. To use this providers services the java.library.pat system property needs to be set accordingly to point to a location that cont libsunec.so . Note that if java.library.path is not set it defaults to the current working directory. Exception in thread "main" org.codehaus.groovy.runtime.InvokerInvocationExce java.lang.UnsatisfiedLinkError: sun.security.ec.ECKeyPairGenerator.generateE [symbol: Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair or Java_s $
  77. ••• $ ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.dgm$55 at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSuppor at java.lang.ClassLoader.loadClass(Target_java_lang_ClassLoader.java:131)

    at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.createProxy(G at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.proxy(Generat at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3196 ... $
  78. ••• $ ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.dgm$55 at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSuppor at java.lang.ClassLoader.loadClass(Target_java_lang_ClassLoader.java:131)

    at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.createProxy(G at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.proxy(Generat at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3196 ... $
  79. ••• $ ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.dgm$55 at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSuppor at java.lang.ClassLoader.loadClass(Target_java_lang_ClassLoader.java:131)

    at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.createProxy(G at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.proxy(Generat at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3196 ... $ vim reflections.json
  80. ••• [ { "name": "jobs", "allDeclaredConstructors": true, "allPublicConstructors": true, "allDeclaredMethods":

    true, "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ reflections.json
  81. ••• [ { "name": "jobs", "allDeclaredConstructors": true, "allPublicConstructors": true, "allDeclaredMethods":

    true, "allPublicMethods": true },{ "name": "org.codehaus.groovy.runtime.dgm$55", "allDeclaredConstructors": true, "allPublicConstructors": true, "allDeclaredMethods": true, "allPublicMethods": true } ] ~ ~ ~ ~ ~ ~ reflections.json
  82. ••• $ ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.dgm$55 at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSuppor at java.lang.ClassLoader.loadClass(Target_java_lang_ClassLoader.java:131)

    at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.createProxy(G at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.proxy(Generat at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:3196 ... $ vim reflections.json $
  83. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs
  84. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs [jobs:9386] classlist: 2,433.79 ms [jobs:9386] (cap): 855.86 ms [jobs:9386] setup: 2,115.01 ms [jobs:9386] (typeflow): 13,953.49 ms ... [jobs:9386] (compile): 30,385.07 ms [jobs:9386] compile: 39,845.02 ms [jobs:9386] image: 3,220.12 ms [jobs:9386] write: 385.24 ms [jobs:9386] [total]: 79,018.80 ms $
  85. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs [jobs:9386] classlist: 2,433.79 ms [jobs:9386] (cap): 855.86 ms [jobs:9386] setup: 2,115.01 ms [jobs:9386] (typeflow): 13,953.49 ms ... [jobs:9386] (compile): 30,385.07 ms [jobs:9386] compile: 39,845.02 ms [jobs:9386] image: 3,220.12 ms [jobs:9386] write: 385.24 ms [jobs:9386] [total]: 79,018.80 ms $
  86. ••• $ ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 ... ========================================== Technical Lead, GitHub Solutions

    Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  87. ••• $ time ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m0,672s user 0m0,019s sys 0m0,005s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  88. ••• $ time ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m0,672s user 0m0,019s sys 0m0,005s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  89. ••• $ time ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m0,672s vs. 0m1,744s user 0m0,019s sys 0m0,005s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  90. ••• $ time ./jobs -Djava.library.path=$JAVA_HOME/jre/lib/amd64 ... ========================================== Technical Lead, GitHub

    Solutions Portland, OR or Offsite- USA @ Autodesk Wed Nov 14 17:01:38 UTC 2018 ========================================== real 0m0,672s vs. 0m1,744s vs. 0m1,395s user 0m0,019s sys 0m0,005s $ https://jobs.github.com/positions/b0332ea6-e82e-11e8-83b0-deabde06afe8
  91. ••• $ java -cp "${CPH}" \ -agentlib:native-image-agent=config-output-dir=conf/ \ jobs >/dev/null

    $ ls -la conf/*.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/jni-config.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/proxy-config.json -rw-rw-r-- 1 user user 16795 05-21 18:31 conf/reflect-config.json -rw-rw-r-- 1 user user 150 05-21 18:31 conf/resource-config.json $
  92. ••• $ java -cp "${CPH}" \ -agentlib:native-image-agent=config-output-dir=conf/ \ jobs >/dev/null

    $ ls -la conf/*.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/jni-config.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/proxy-config.json -rw-rw-r-- 1 user user 16795 05-21 18:31 conf/reflect-config.json -rw-rw-r-- 1 user user 150 05-21 18:31 conf/resource-config.json $
  93. ••• $ java -cp "${CPH}" \ -agentlib:native-image-agent=config-output-dir=conf/ \ jobs >/dev/null

    $ ls -la conf/*.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/jni-config.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/proxy-config.json -rw-rw-r-- 1 user user 16795 05-21 18:31 conf/reflect-config.json -rw-rw-r-- 1 user user 150 05-21 18:31 conf/resource-config.json $ wc -l conf/reflect-config.json
  94. ••• $ java -cp "${CPH}" \ -agentlib:native-image-agent=config-output-dir=conf/ \ jobs >/dev/null

    $ ls -la conf/*.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/jni-config.json -rw-rw-r-- 1 user user 4 05-21 18:31 conf/proxy-config.json -rw-rw-r-- 1 user user 16795 05-21 18:31 conf/reflect-config.json -rw-rw-r-- 1 user user 150 05-21 18:31 conf/resource-config.json $ wc -l conf/reflect-config.json 627 conf/reflect-config.json $
  95. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ReflectionConfigurationFiles=reflections.json \ --enable-url-protocols=http,https \ jobs
  96. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy \ --enable-url-protocols=http,https \ jobs
  97. ••• $ native-image --no-server \ -cp "${CPH}" \ --allow-incomplete-classpath \

    --no-fallback \ --report-unsupported-elements-at-runtime \ --initialize-at-build-time \ --initialize-at-run-time=org.codehaus.groovy.control.XStreamUtils,groovy -H:ConfigurationFileDirectories=conf/ \ --enable-url-protocols=http,https \ jobs
  98. Runtime metaprogramming Runtime metaprogramming Substrate VM (ahead-of-time compiler) does not

    support dynamic class generation, InvokeDynamic* Bytecode and Method Handle.  
  99. Runtime metaprogramming Runtime metaprogramming Substrate VM (ahead-of-time compiler) does not

    support dynamic class generation, InvokeDynamic* Bytecode and Method Handle. (* except a single virtual call reduction used for Java 8 Lambda expressions)  
  100. Dynamic nature Dynamic nature In most cases Groovy dynamic idioms

    won’t compile with AOT, thus it is recommended to use static compilation instead.  
  101. Closure coercion to SAM Closure coercion to SAM A closure

    coercion to SAM ( single abstract method ) type is currently not supported.  
  102. Closure coercion to SAM Closure coercion to SAM A closure

    coercion to SAM ( single abstract method ) type is currently not supported.   https://github.com/oracle/graal/issues/1306
  103. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter { int n -> n > 10 } .sum() println "result = ${result}" } }
  104. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter { int n -> n > 10 } .sum() println "result = ${result}" } }
  105. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter { int n -> n > 10 } .sum() println "result = ${result}" } } 
  106. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter { int n -> n > 10 } .sum() println "result = ${result}" } }
  107. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter(new IntPredicate() { @Override boolean test(int n) { return n > 10 } }) .sum() println "result = ${result}" } }
  108. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter(new IntPredicate() { // Works for Groovy 2.x @Override boolean test(int n) { return n > 10 } }) .sum() println "result = ${result}" } } 
  109. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter(n -> n > 10) .sum() println "result = ${result}" } }
  110. ••• package example import java.util.function.IntPredicate import java.util.stream.IntStream class App {

    static void main(String[] args) { def result = IntStream.range(0, 100) .filter(n -> n > 10) // Works for Groovy 3.x .sum() println "result = ${result}" } } 
  111. Grape dependencies Grape dependencies It doesn’t work out of the

    box, but you can apply a workaround  
  112. Grape dependencies Grape dependencies It doesn’t work out of the

    box, but you can apply a workaround Collect all JARs to a single folder groovy -Dgrape.root=libs/ …   
  113. Grape dependencies Grape dependencies It doesn’t work out of the

    box, but you can apply a workaround Collect all JARs to a single folder groovy -Dgrape.root=libs/ … Put all collected JARs to the classpath    
  114. Grape dependencies Grape dependencies It doesn’t work out of the

    box, but you can apply a workaround Collect all JARs to a single folder groovy -Dgrape.root=libs/ … Put all collected JARs to the classpath Compile native image with -Dgroovy.grape.enable=false     
  115. Grape dependencies Grape dependencies It doesn’t work out of the

    box, but you can apply a workaround Collect all JARs to a single folder groovy -Dgrape.root=libs/ … Put all collected JARs to the classpath Compile native image with -Dgroovy.grape.enable=false       https://e.printstacktrace.blog/graalvm-groovy-grape-creating- native-image-of-standalone-script/
  116. Conclusions Conclusions Almost instant startup thanks to ahead-of-time compilation Great

    choice for small CLI programs, FaaS (function as a service)  
  117. Conclusions Conclusions Almost instant startup thanks to ahead-of-time compilation Great

    choice for small CLI programs, FaaS (function as a service) You can use it with Picocli ( ) for command line tools    https://picocli.info
  118. Conclusions Conclusions Almost instant startup thanks to ahead-of-time compilation Great

    choice for small CLI programs, FaaS (function as a service) You can use it with Picocli ( ) for command line tools Micronaut supports GraalVM TM native images out-of-the-box (Java)    https://picocli.info 
  119. Conclusions Conclusions Almost instant startup thanks to ahead-of-time compilation Great

    choice for small CLI programs, FaaS (function as a service) You can use it with Picocli ( ) for command line tools Micronaut supports GraalVM TM native images out-of-the-box (Java) Ratpack 1.6+ can compile to the native image (Java)    https://picocli.info  
  120. Conclusions Conclusions Almost instant startup thanks to ahead-of-time compilation Great

    choice for small CLI programs, FaaS (function as a service) You can use it with Picocli ( ) for command line tools Micronaut supports GraalVM TM native images out-of-the-box (Java) Ratpack 1.6+ can compile to the native image (Java) native-image is available as an early adopter plugin - expect changes and accept its experimental nature    https://picocli.info   
  121. That’s all, folks! Do you have any questions? Handout ,

    slides, demos, and all materials are available:  https://github.com/wololock/groovy-and-graalvm Thank you! Thank you!