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

Quarkus.io + Kotlin = Supersonic Kotlin

Quarkus.io + Kotlin = Supersonic Kotlin

Quarkus.io is the new open source framework and toolset that brings a lot of productivity enhancements to Java. Its benefits are not limited to Java developers, Kotlin support is very good and we will explore the real benefits it can bring to your system. First we will see in live coding the productivity benefit of Quarkus dev mode with fast and safe hot replacement.
And then we will compare Kotlin native to graalvm native code, two technologies with very different goals and targets.

Uberto Barbini

November 02, 2019
Tweet

More Decks by Uberto Barbini

Other Decks in Programming

Transcript

  1. - Quarkus.io - Cloud friendly toolchain - Awesome DevMode -

    Graal Native - Kotlin - Kotlin Native - Demo Kotlin QuarkusDev - Demo Kotlin QuarkusNative - Demo Kotlin Native - QA Quarkus.io + Kotlin
  2. Quarkus.io: Super Cloud Friendly Docker battery-included extensions for (almost) any

    framework easy to create new extensions tests are first citizens fully support Kotlin (yeah!)
  3. Dev Mode ./gradlew quarkusDev ./mvnw quarkus:dev Seriously fast hot redeploy

    Instantaneous feedback ./gradlew quarkusBuild --uber-jar
  4. Quarkus Native Super fast startup No Jvm needed Linux and

    MacOs only Limited reflection No resources No class loading Slow compile sdk i java 19.2.1-grl
  5. Quarkus-io DevMode Running 10s test @ http://localhost:8080/hello 10 connections ┌─────────┬──────┬──────┬───────┬───────┬─────────┬────────┬──────────┐

    │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼───────┼─────────┼────────┼──────────┤ │ Latency │ 0 ms │ 5 ms │ 9 ms │ 10 ms │ 4.58 ms │ 2.7 ms │ 15.24 ms │ └─────────┴──────┴──────┴───────┴───────┴─────────┴────────┴──────────┘ ┌───────────┬────────┬────────┬────────┬────────┬─────────┬─────────┬────────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼────────┼────────┼────────┼────────┼─────────┼─────────┼────────┤ │ Req/Sec │ 1831 │ 1831 │ 1992 │ 2087 │ 1957.64 │ 91.82 │ 1831 │ ├───────────┼────────┼────────┼────────┼────────┼─────────┼─────────┼────────┤ │ Bytes/Sec │ 255 kB │ 255 kB │ 277 kB │ 290 kB │ 272 kB │ 12.7 kB │ 255 kB │ └───────────┴────────┴────────┴────────┴────────┴─────────┴─────────┴────────┘ Req/Bytes counts sampled once per second. 22k requests in 11.03s, 2.99 MB read
  6. Quarkus-io ProdMode Running 10s test @ http://localhost:8080/hello 10 connections ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬──────────┐

    │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼──────────┤ │ Latency │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0.01 ms │ 0.12 ms │ 11.48 ms │ └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴──────────┘ ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Req/Sec │ 29871 │ 29871 │ 34111 │ 34591 │ 33464 │ 1476.36 │ 29866 │ ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Bytes/Sec │ 3.91 MB │ 3.91 MB │ 4.47 MB │ 4.53 MB │ 4.38 MB │ 193 kB │ 3.91 MB │ └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ Req/Bytes counts sampled once per second. 335k requests in 10.04s, 43.8 MB read UberJar: 11,292,932 bytes
  7. Quarkus Native Running 10s test @ http://localhost:8080/hello 10 connections ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬──────────┐

    │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼──────────┤ │ Latency │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0.01 ms │ 0.22 ms │ 23.93 ms │ └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴──────────┘ ┌───────────┬────────┬────────┬─────────┬─────────┬──────────┬─────────┬────────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼─────────┼────────┤ │ Req/Sec │ 25887 │ 25887 │ 30271 │ 30639 │ 29753.46 │ 1259.52 │ 25873 │ ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼─────────┼────────┤ │ Bytes/Sec │ 3.6 MB │ 3.6 MB │ 4.21 MB │ 4.26 MB │ 4.14 MB │ 175 kB │ 3.6 MB │ └───────────┴────────┴────────┴─────────┴─────────┴──────────┴─────────┴────────┘ Req/Bytes counts sampled once per second. 327k requests in 11.04s, 45.5 MB read exe size: 23,900,440 bytes
  8. Kotlin Native (picoserver) Running 10s test @ http://localhost:8080/hello 10 connections

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬─────────┐ │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │ ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼─────────┤ │ Latency │ 0 ms │ 0 ms │ 1 ms │ 1 ms │ 0.08 ms │ 0.34 ms │ 8.15 ms │ └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴─────────┘ ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐ │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │ ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤ │ Req/Sec │ 8831 │ 8831 │ 11503 │ 11935 │ 11292.73 │ 797.78 │ 8826 │ ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤ │ Bytes/Sec │ 1.26 MB │ 1.26 MB │ 1.64 MB │ 1.71 MB │ 1.61 MB │ 114 kB │ 1.26 MB │ └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘ Req/Bytes counts sampled once per second. 124k requests in 11.03s, 17.8 MB read exe size: 381,880 bytes
  9. Your choice! Quarkus JVM: Fast eventually, big memory (11Mb +

    Jvm), slow startup (500 ms.) Quarkus DevMode: Slow, hot class swap, fast development Quarkus Native: Fast, small memory (20Mb no Jvm), fast startup (5 ms.) Kotlin Native: Fast, tiny memory (<1Mb), super fast startup (<1 ms.), no JVM libraries
  10. Wrap up Quarkus-io Great for Microservices and Serverless Super Great

    with Kotlin Kotlin Native great for embedded