Skip to content

Commit 357165c

Browse files
authored
[micronaut] Add loom variants (#10055)
* loom benchmarks * inherit JAVA_OPTIONS * add async-profiler support * Revert "add async-profiler support" This reverts commit 497c017. * disable trackAllThreads * more logging * try disabling throughput mode * io_uring * remove views dependency * use io_uring for all vertx connections
1 parent f26732f commit 357165c

File tree

12 files changed

+286
-90
lines changed

12 files changed

+286
-90
lines changed

frameworks/Java/micronaut/benchmark_config.json

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"webserver": "Netty",
2222
"os": "Linux",
2323
"database_os": "Linux",
24-
"display_name": "Micronaut Vertx PG Client",
24+
"display_name": "Micronaut [Vertx PG Client]",
2525
"notes": "",
2626
"versus": "None"
2727
},
@@ -44,7 +44,53 @@
4444
"webserver": "Netty",
4545
"os": "Linux",
4646
"database_os": "Linux",
47-
"display_name": "Micronaut Vertx PG Client GraalVM",
47+
"display_name": "Micronaut [Vertx PG Client] [GraalVM]",
48+
"notes": "",
49+
"versus": "None"
50+
},
51+
"loom-fjp": {
52+
"json_url": "/json",
53+
"plaintext_url": "/plaintext",
54+
"db_url": "/db",
55+
"query_url": "/queries?queries=",
56+
"fortune_url": "/fortunes",
57+
"update_url": "/updates?queries=",
58+
"port": 8080,
59+
"approach": "Realistic",
60+
"classification": "Micro",
61+
"database": "Postgres",
62+
"framework": "Micronaut",
63+
"language": "Java",
64+
"flavor": "None",
65+
"orm": "Raw",
66+
"platform": "Netty",
67+
"webserver": "Netty",
68+
"os": "Linux",
69+
"database_os": "Linux",
70+
"display_name": "Micronaut [Vertx PG Client] [Virtual Threads FJP]",
71+
"notes": "",
72+
"versus": "None"
73+
},
74+
"loom-on-netty": {
75+
"json_url": "/json",
76+
"plaintext_url": "/plaintext",
77+
"db_url": "/db",
78+
"query_url": "/queries?queries=",
79+
"fortune_url": "/fortunes",
80+
"update_url": "/updates?queries=",
81+
"port": 8080,
82+
"approach": "Realistic",
83+
"classification": "Micro",
84+
"database": "Postgres",
85+
"framework": "Micronaut",
86+
"language": "Java",
87+
"flavor": "None",
88+
"orm": "Raw",
89+
"platform": "Netty",
90+
"webserver": "Netty",
91+
"os": "Linux",
92+
"database_os": "Linux",
93+
"display_name": "Micronaut [Vertx PG Client] [Virtual Threads Loom-On-Netty]",
4894
"notes": "",
4995
"versus": "None"
5096
},
@@ -65,7 +111,7 @@
65111
"webserver": "Netty",
66112
"os": "Linux",
67113
"database_os": "Linux",
68-
"display_name": "Micronaut JDBC",
114+
"display_name": "Micronaut [JDBC]",
69115
"notes": "",
70116
"versus": "None"
71117
},
@@ -86,7 +132,7 @@
86132
"webserver": "Netty",
87133
"os": "Linux",
88134
"database_os": "Linux",
89-
"display_name": "Micronaut JDBC GraalVM",
135+
"display_name": "Micronaut [JDBC] [GraalVM]",
90136
"notes": "",
91137
"versus": "None"
92138
},
@@ -107,7 +153,7 @@
107153
"webserver": "Netty",
108154
"os": "Linux",
109155
"database_os": "Linux",
110-
"display_name": "Micronaut R2DBC",
156+
"display_name": "Micronaut [R2DBC]",
111157
"notes": "",
112158
"versus": "None"
113159
},
@@ -128,7 +174,7 @@
128174
"webserver": "Netty",
129175
"os": "Linux",
130176
"database_os": "Linux",
131-
"display_name": "Micronaut R2DBC GraalVM",
177+
"display_name": "Micronaut [R2DBC] [GraalVM]",
132178
"notes": "",
133179
"versus": "None"
134180
},
@@ -149,7 +195,7 @@
149195
"webserver": "Netty",
150196
"os": "Linux",
151197
"database_os": "Linux",
152-
"display_name": "Micronaut Data JDBC",
198+
"display_name": "Micronaut [Data JDBC]",
153199
"notes": "",
154200
"versus": "None"
155201
},
@@ -170,7 +216,7 @@
170216
"webserver": "Netty",
171217
"os": "Linux",
172218
"database_os": "Linux",
173-
"display_name": "Micronaut Data JDBC GraalVM",
219+
"display_name": "Micronaut [Data JDBC] [GraalVM]",
174220
"notes": "",
175221
"versus": "None"
176222
},
@@ -191,7 +237,7 @@
191237
"webserver": "Netty",
192238
"os": "Linux",
193239
"database_os": "Linux",
194-
"display_name": "Micronaut Data MongoDB",
240+
"display_name": "Micronaut [Data MongoDB]",
195241
"notes": "",
196242
"versus": "None"
197243
},
@@ -212,7 +258,7 @@
212258
"webserver": "Netty",
213259
"os": "Linux",
214260
"database_os": "Linux",
215-
"display_name": "Micronaut Data MongoDB GraalVM",
261+
"display_name": "Micronaut [Data MongoDB] [GraalVM]",
216262
"notes": "",
217263
"versus": "None"
218264
}

frameworks/Java/micronaut/common/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ dependencies {
3434
transitive = false
3535
}
3636

37-
implementation("io.micronaut.views:micronaut-views-jte")
37+
implementation("gg.jte:jte")
38+
39+
runtimeOnly("io.netty:netty-transport-native-io_uring::linux-x86_64")
3840

3941
runtimeOnly("ch.qos.logback:logback-classic")
4042
runtimeOnly("org.yaml:snakeyaml")

frameworks/Java/micronaut/common/src/main/java/benchmark/Application.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
package benchmark;
22

33
import io.micronaut.runtime.Micronaut;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
46

57
public class Application {
68

9+
private static final Logger log = LoggerFactory.getLogger(Application.class);
10+
711
public static void main(String[] args) {
12+
log.info("Runtime.maxMemory: {}", Runtime.getRuntime().maxMemory());
13+
log.info("Runtime.totalMemory: {}", Runtime.getRuntime().totalMemory());
14+
log.info("Runtime.availableProcessors: {}", Runtime.getRuntime().availableProcessors());
15+
816
Micronaut.build(args).environments("common").classes(Application.class).start();
917
}
1018

frameworks/Java/micronaut/common/src/main/resources/application-common.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ micronaut:
66
server-header: Micronaut
77
date-header: false
88
validate-url: false
9+
netty:
10+
parent:
11+
event-loop-group: default
12+
prefer-native-transport: true
13+
worker:
14+
event-loop-group: default
15+
prefer-native-transport: true
16+
http:
17+
client:
18+
event-loop-group: default
19+
netty:
20+
event-loops:
21+
default:
22+
prefer-native-transport: true
923

1024
netty:
1125
resource-leak-detector-level: DISABLED
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
micronaut:
2+
netty:
3+
event-loops:
4+
default:
5+
loom-carrier: true
6+
loom-carrier:
7+
work-spill-threshold: 1000000
8+
throughput-mode-threshold: 1000000
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
micronaut:
2+
server:
3+
thread-selection: blocking

frameworks/Java/micronaut/common/src/main/resources/logback.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
<appender-ref ref="STDOUT" />
1313
</root>
1414

15+
<logger name="io.netty.util.internal.PlatformDependent" level="debug"/>
16+
<logger name="io.netty.buffer.PooledByteBufAllocator" level="debug"/>
17+
<logger name="io.netty.buffer.AdaptiveByteBufAllocator" level="debug"/>
1518
</configuration>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM gradle:8.14.3-jdk21 as build
2+
COPY --chown=gradle:gradle . /home/gradle/src
3+
WORKDIR /home/gradle/src
4+
RUN gradle micronaut-vertx-pg-client:build -x test -x internalStartTestResourcesService --no-daemon
5+
6+
FROM openjdk:24
7+
WORKDIR /micronaut
8+
COPY --from=build /home/gradle/src/micronaut-vertx-pg-client/build/libs/micronaut-vertx-pg-client-all.jar micronaut.jar
9+
COPY run_benchmark.sh run_benchmark.sh
10+
11+
EXPOSE 8080
12+
ENV MN_ENV=loom
13+
ENTRYPOINT "./run_benchmark.sh"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM gradle:8.14.3-jdk21 as build
2+
COPY --chown=gradle:gradle . /home/gradle/src
3+
WORKDIR /home/gradle/src
4+
RUN gradle micronaut-vertx-pg-client:build -x test -x internalStartTestResourcesService --no-daemon
5+
6+
FROM openjdk:24
7+
WORKDIR /micronaut
8+
COPY --from=build /home/gradle/src/micronaut-vertx-pg-client/build/libs/micronaut-vertx-pg-client-all.jar micronaut.jar
9+
COPY run_benchmark.sh run_benchmark.sh
10+
11+
EXPOSE 8080
12+
ENV MN_ENV=loom,loom-on-netty
13+
ENTRYPOINT "./run_benchmark.sh"

frameworks/Java/micronaut/micronaut-vertx-pg-client/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ micronaut {
99
}
1010

1111
dependencies {
12-
implementation("io.vertx:vertx-pg-client")
12+
implementation("io.vertx:vertx-pg-client:5.0.2")
1313
implementation('com.ongres.scram:client')
1414
}

0 commit comments

Comments
 (0)