Slide 1

Slide 1 text

5 ½ cool things to do with Quarkus Holly Cummins IBM

Slide 2

Slide 2 text

save the world 1

Slide 3

Slide 3 text

1 save the world

Slide 4

Slide 4 text

@holly_cummins #RedHat Sources: https://www.greenit.fr/wp-content/uploads/2019/11/GREENIT_EENM_etude_EN_accessible.pdf https://ourworldindata.org/ghg-emissions-by-sector the digital world creates more carbon emissions than aviation

Slide 5

Slide 5 text

@holly_cummins #RedHat Lighter area represents high and low estimates, where available. Sources: https://www.iea.org/fuels-and-technologies/data-centres-networks https://ourworldindata.org/grapher/electricity-demand?tab=table&country=USA~GBR~FRA~DEU~IND~BRA data centres use as much electricity as a medium country

Slide 6

Slide 6 text

how can quarkus help??

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

https://github.com/quarkusio/spring-quarkus-perf-comparison

Slide 9

Slide 9 text

here’s what we see in our controlled lab JVM Native Quarkus Spring Boot Ratio (Quarkus / SB) Spring Boot (w/AOT) Ratio (Quarkus / SB AOT) Ratio (SB AOT / SB) Quarkus Spring Boot Ratio (Quarkus / SB) Framework version 3.22.3 3.4.5 3.4.5 3.22.3 3.4.5 Build time (s) 13.15 7.60 172.95% 17.02 77.26% 223.85% 178.99 279.45 64.05% Av. RSS after startup (MB) 192.31 298.09 64.51% 290.40 66.22% 97.42% 71.22 205.74 34.62% Av. time to 1st req (ms) 4652.67 8770.33 53.05% 8180.67 56.87% 93.28% 135.67 916.67 14.80% Av. RSS after 1st req (MB) 244.61 339.52 27.05% 331.78 73.73% 97.72% 79.12 208.21 38.00% Av. throughput (req/sec) 30,397.95 6,495.20 468.01% 6,427.64 472.93% 98.96% 16,753.94 6,146.27 272.59% Max throughput density (req/sec/MB) 35.79 7.95 450.50% 7.89 453.88% 99.26% 59.82 15.94 375.27% Build RSS (GB) 5.62 157.04 57.92% Binary Size (MB) 90.95 157.04 57.92% https://github.com/edeandrea/quarkus-for-spring-devs-examples/tree/quarkus-for-spring-devs-talk-sb3 8 cores, 14GB RAM, GraalVM CE 21.0.2

Slide 10

Slide 10 text

was this an easy demo?

Slide 11

Slide 11 text

was this an easy demo? - i broke all the performance best practices :) - measuring on a laptop - generating load on the same machine

Slide 12

Slide 12 text

?

Slide 13

Slide 13 text

it’s not really about throughput

Slide 14

Slide 14 text

it’s about hardware

Slide 15

Slide 15 text

… hardware is also money

Slide 16

Slide 16 text

we can simulate running in containers https://github.com/jponge/volcamp25-quarkus/

Slide 17

Slide 17 text

spring boot quarkus

Slide 18

Slide 18 text

spring boot quarkus 40 586 req/s

Slide 19

Slide 19 text

spring boot quarkus 40 586 req/s 17 209 req/s

Slide 20

Slide 20 text

spring boot quarkus 40 586 req/s 17 209 req/s 1 342 errors

Slide 21

Slide 21 text

spring boot quarkus 40 586 req/s 17 209 req/s 1 342 errors 2 vCPUs 0.5 GiB

Slide 22

Slide 22 text

spring boot quarkus t3.nano $0.0052 40 586 req/s 17 209 req/s 1 342 errors 2 vCPUs 0.5 GiB

Slide 23

Slide 23 text

spring boot quarkus t3.nano $0.0052 40 586 req/s 17 209 req/s 1 342 errors 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 24

Slide 24 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 25

Slide 25 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $3.87 a month 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 26

Slide 26 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $15.47 a month $3.87 a month 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 27

Slide 27 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $15.47 a month $3.87 a month x2 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 28

Slide 28 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $15.47 a month $3.87 a month $30.94 a month x2 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 29

Slide 29 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $15.47 a month $3.87 a month $30.94 a month x2 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 30

Slide 30 text

spring boot quarkus t3.nano $0.0052 t3.small $0.0208 40 586 req/s 17 209 req/s 1 342 errors $15.47 a month $3.87 a month $30.94 a month x2 2 vCPUs 2 GiB 2 vCPUs 0.5 GiB

Slide 31

Slide 31 text

tell your boss you learned… -quarkus uses 2 - 8x fewer compute resources than spring -quarkus is 2 - 8x cheaper to run than spring

Slide 32

Slide 32 text

??

Slide 33

Slide 33 text

the economic model low costs correlate to low energy usage

Slide 34

Slide 34 text

the vrrrrooooom model high throughput correlates to low energy usage

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

t3.nano t3.small 2x t3.small Watts per hour 12.5 14 28

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

9000 potatoes

Slide 43

Slide 43 text

0.0007 W

Slide 44

Slide 44 text

t3.nano t3.small 2x t3.small Watts per hour 12.5 14 28

Slide 45

Slide 45 text

t3.nano t3.small 2x t3.small Watts per hour 12.5 14 28 Lemons per hour 17,857 20,000 40,000

Slide 46

Slide 46 text

spring boot 40,000 lemons/hour quarkus 17,857 lemons/hour

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

jbang wrk2@hyperfoil -t2 -c100 -d30s -R 200 --latency http:// localhost:8080/fruits jbang wrk@hyperfoil -t2 -c100 -d20s --timeout 1s http:// localhost:8080/fruits sudo powermetrics --samplers cpu_power,tasks --show-process- samp-norm --show-process-gpu --show-usage-summary -i 0 -o output.txt

Slide 49

Slide 49 text

tell your boss you learned… -lowering costs and hardware usage is good for the planet -quarkus helps :)

Slide 50

Slide 50 text

was this an easy demo?

Slide 51

Slide 51 text

was this an easy demo?

Slide 52

Slide 52 text

was this an easy demo? -bringing 77 ,857 lemons to malmö turned out to be hard

Slide 53

Slide 53 text

was this an easy demo? -bringing 77 ,857 lemons to malmö turned out to be hard -the energy measurement tooling is bleeding edge (still being written by christophe!)

Slide 54

Slide 54 text

2 how quick can quarkus go?

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

thanks to markus eisele for the graphics code https://github.com/holly-cummins/meme-generator

Slide 57

Slide 57 text

was this an easy demo?

Slide 58

Slide 58 text

was this an easy demo?

Slide 59

Slide 59 text

was this an easy demo? -writing the cli was easy -native compilation was easy -native compilation + awt + mac is very hard

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

i tried:

Slide 62

Slide 62 text

i tried: native awt on mac

Slide 63

Slide 63 text

i tried: native awt on mac liberica vm on mac + tuning of build-time and runtime classes

Slide 64

Slide 64 text

i tried: native awt on mac liberica vm on mac + tuning of build-time and runtime classes graalvm community container

Slide 65

Slide 65 text

i tried: native awt on mac liberica vm on mac + tuning of build-time and runtime classes graalvm community container mandrel container

Slide 66

Slide 66 text

tell your boss you learned… •picocli + quarkus is a great combination •native is clever tech •…but native has dragons •only go native if you actually need it

Slide 67

Slide 67 text

wasm 3

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

java code

Slide 70

Slide 70 text

java code bytecode

Slide 71

Slide 71 text

java code bytecode javac

Slide 72

Slide 72 text

java runtime java code bytecode javac

Slide 73

Slide 73 text

java runtime java code bytecode interpreter javac

Slide 74

Slide 74 text

java runtime java code bytecode interpreter compiler javac jit

Slide 75

Slide 75 text

java runtime java code bytecode interpreter compiler javac jit

Slide 76

Slide 76 text

java runtime java code bytecode interpreter compiler javac jit kotlin

Slide 77

Slide 77 text

java runtime java code bytecode interpreter compiler javac jit kotlin groovy

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

wasm

Slide 80

Slide 80 text

wasm runtime wasm

Slide 81

Slide 81 text

wasm runtime wasm interpreter

Slide 82

Slide 82 text

wasm runtime wasm interpreter compiler

Slide 83

Slide 83 text

wasm runtime wasm interpreter compiler

Slide 84

Slide 84 text

wasm runtime wasm interpreter compiler c code

Slide 85

Slide 85 text

wasm runtime wasm interpreter compiler c code rust code

Slide 86

Slide 86 text

wasm runtime javascript code wasm interpreter compiler c code rust code

Slide 87

Slide 87 text

wasm runtime javascript code wasm interpreter compiler c code rust code js interpreter

Slide 88

Slide 88 text

wasm runtime wasm runtime wasm runtime javascript code wasm interpreter compiler c code rust code js interpreter

Slide 89

Slide 89 text

java runtime java code bytecode interpreter compiler kotlin groovy wasm c code rust code

Slide 90

Slide 90 text

java runtime java code bytecode interpreter compiler kotlin groovy wasm c code rust code wasm runtime

Slide 91

Slide 91 text

@holly_cummins

Slide 92

Slide 92 text

@holly_cummins

Slide 93

Slide 93 text

@holly_cummins

Slide 94

Slide 94 text

url: https://github.com/andreaTP/quarkus-photon-demo

Slide 95

Slide 95 text

was this an easy demo?

Slide 96

Slide 96 text

was this an easy demo? - running rust in a jvm is … easy? - live reload would be better with a quarkus extension

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

“Running JavaScript in a C runtime compiled to WebAssembly on the JVM is the new black.” - Andrea Peruffo

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

tell your boss you learned… -polyglot is here -language doesn’t need to be a barrier

Slide 101

Slide 101 text

but what if the code i want to run in quarkus is spring code? 4

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

https://github.com/quarkusio/spring-quarkus-perf-comparison

Slide 105

Slide 105 text

was this an easy demo?

Slide 106

Slide 106 text

was this an easy demo? - all the hard work was already done - … but notice we didn’t attempt the tests

Slide 107

Slide 107 text

tell your boss you learned… -you can get to quarkus from spring -compatibility libraries -migration tooling

Slide 108

Slide 108 text

ai for the rest of us 5

Slide 109

Slide 109 text

@holly_cummins #Quarkus #IBM #RedHat

Slide 110

Slide 110 text

@holly_cummins #Quarkus #IBM #RedHat

Slide 111

Slide 111 text

@holly_cummins #Quarkus #IBM #RedHat ai has most value when it is integrated

Slide 112

Slide 112 text

@holly_cummins #Quarkus #IBM #RedHat generative ai has a python problem

Slide 113

Slide 113 text

@holly_cummins #Quarkus #IBM #RedHat deploy to prod rest api train the model

Slide 114

Slide 114 text

@holly_cummins #Quarkus #IBM #RedHat deploy to prod rest api train the model use output in code standardize prompt structures switch from one LLM model to another memory (context)

Slide 115

Slide 115 text

@holly_cummins #Quarkus #IBM #RedHat deploy to prod rest api train the model use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain

Slide 116

Slide 116 text

@holly_cummins #Quarkus #IBM #RedHat deploy to prod rest api train the model use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain langchain4j

Slide 117

Slide 117 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j

Slide 118

Slide 118 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data

Slide 119

Slide 119 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection

Slide 120

Slide 120 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection annotations

Slide 121

Slide 121 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection annotations live coding

Slide 122

Slide 122 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection annotations live coding failover

Slide 123

Slide 123 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection annotations live coding failover mockability

Slide 124

Slide 124 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) langchain4j easy access to data dependency injection annotations live coding failover mockability observability

Slide 125

Slide 125 text

@holly_cummins #Quarkus #IBM #RedHat use output in code standardize prompt structures switch from one LLM model to another memory (context) quarkus langchain4j langchain4j easy access to data dependency injection annotations live coding failover mockability observability

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

@holly_cummins #Quarkus #IBM #RedHat https://github.com/holly-cummins/ quarkus-langchain4j-pet-adoption-demo

Slide 128

Slide 128 text

tell your boss you learned… -langchain4j + quarkus makes integrating gen ai easy -structured data is nice

Slide 129

Slide 129 text

minecraft observability 5½

Slide 130

Slide 130 text

observability

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

user code

Slide 133

Slide 133 text

user code quarkus framework

Slide 134

Slide 134 text

application user code quarkus framework

Slide 135

Slide 135 text

application user code quarkus framework extensions

Slide 136

Slide 136 text

application user code quarkus framework extensions

Slide 137

Slide 137 text

application user code quarkus framework client extensions

Slide 138

Slide 138 text

application user code quarkus framework client extensions

Slide 139

Slide 139 text

application user code quarkus framework client extensions

Slide 140

Slide 140 text

application user code quarkus framework client extensions

Slide 141

Slide 141 text

application user code quarkus framework client extensions observability stack

Slide 142

Slide 142 text

application user code quarkus framework client metrics extensions observability stack

Slide 143

Slide 143 text

application user code quarkus framework client metrics traces extensions observability stack

Slide 144

Slide 144 text

application user code quarkus framework client metrics traces logs extensions observability stack

Slide 145

Slide 145 text

application user code quarkus framework observability client client metrics traces logs extensions observability stack

Slide 146

Slide 146 text

application user code quarkus framework observability client client metrics traces logs extensions observability stack

Slide 147

Slide 147 text

application user code quarkus framework observability client client dev service (testcontainers) extensions observability stack

Slide 148

Slide 148 text

application user code quarkus framework client extensions

Slide 149

Slide 149 text

application user code quarkus framework client extensions

Slide 150

Slide 150 text

application user code quarkus framework client extensions minecraft server

Slide 151

Slide 151 text

application user code quarkus framework minecraft client client extensions minecraft server

Slide 152

Slide 152 text

application user code quarkus framework minecraft client client extensions minecraft server

Slide 153

Slide 153 text

application user code quarkus framework minecraft client client extensions minecraft server mod

Slide 154

Slide 154 text

application user code quarkus framework minecraft client client dev service (testcontainers) extensions minecraft server mod

Slide 155

Slide 155 text

No content

Slide 156

Slide 156 text

No content

Slide 157

Slide 157 text

https://github.com/quarkiverse/quarkus-observability-minecraft

Slide 158

Slide 158 text

tell your boss you learned… -you can do a lot with interceptors -dev services are awesome

Slide 159

Slide 159 text

but what about ai?

Slide 160

Slide 160 text

No content

Slide 161

Slide 161 text

https://github.com/quarkiverse/quarkus-observability-minecraft

Slide 162

Slide 162 text

https://github.com/quarkiverse/quarkus-observability-minecraft

Slide 163

Slide 163 text

was this an easy demo?

Slide 164

Slide 164 text

was this an easy demo?

Slide 165

Slide 165 text

was this an easy demo? -extension was easy, minecraft mod was hard

Slide 166

Slide 166 text

was this an easy demo? -extension was easy, minecraft mod was hard -minecraft APIs

Slide 167

Slide 167 text

was this an easy demo? -extension was easy, minecraft mod was hard -minecraft APIs -lack documentation

Slide 168

Slide 168 text

was this an easy demo? -extension was easy, minecraft mod was hard -minecraft APIs -lack documentation -change between minor versions

Slide 169

Slide 169 text

was this an easy demo? -extension was easy, minecraft mod was hard -minecraft APIs -lack documentation -change between minor versions -client-server sync of injected behaviour is hard

Slide 170

Slide 170 text

tell your boss you learned… -typesafe objects are better than a chat box -… but small models may struggle with structured data -gen ai adds latency

Slide 171

Slide 171 text

what have we done?

Slide 172

Slide 172 text

what have we done? 1. seen quarkus uses half as much energy as spring boot

Slide 173

Slide 173 text

what have we done? 1. seen quarkus uses half as much energy as spring boot 2. made a cli that starts really fast

Slide 174

Slide 174 text

what have we done? 1. seen quarkus uses half as much energy as spring boot 2. made a cli that starts really fast 3. used wasm in a quarkus app

Slide 175

Slide 175 text

what have we done? 1. seen quarkus uses half as much energy as spring boot 2. made a cli that starts really fast 3. used wasm in a quarkus app 4. converted a spring app to quarkus

Slide 176

Slide 176 text

what have we done? 1. seen quarkus uses half as much energy as spring boot 2. made a cli that starts really fast 3. used wasm in a quarkus app 4. converted a spring app to quarkus 5. deeply integrated ai

Slide 177

Slide 177 text

what have we done? 1. seen quarkus uses half as much energy as spring boot 2. made a cli that starts really fast 3. used wasm in a quarkus app 4. converted a spring app to quarkus 5. deeply integrated ai 6. used minecraft for observability 5½.

Slide 178

Slide 178 text

https://hollycummins.com/quarkus-cool-things/ 45% off all Manning products: Oredev25