Skip to content

Commit fa5004a

Browse files
authored
Add Avaje Jex (#9885)
1 parent d8d4431 commit fa5004a

19 files changed

+751
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Avaje Jex Benchmarking Test
2+
3+
## Important Libraries
4+
The tests were run with:
5+
* [Java 24](https://openjdk.java.net)
6+
* [Avaje Http 3.3](https://github.com/avaje/avaje-http)
7+
* [Avaje Inject 11.5](https://github.com/avaje/avaje-inject)
8+
* [Avaje Jex 3.2](https://github.com/avaje/avaje-jex)
9+
* [HikariCP 6.3.0](https://github.com/brettwooldridge/HikariCP)
10+
* [jstachio 1.3.7](https://github.com/jstachio/jstachio)
11+
12+
[Avaje Jex](https://avaje.io) is a micro web framework for Java's built-in `jdk.httpserver` API.
13+
14+
```java
15+
Jex.create()
16+
.get("/", ctx -> ctx.text("hello"))
17+
.start();
18+
```
19+
20+
## Test Implementation Source Code
21+
22+
### Plain Text Test
23+
* [Plain test source](src/main/java/benchmark/Main.java)
24+
25+
### JSON Encoding Test
26+
* [JSON test source](src/main/java/benchmark/Main.java)
27+
28+
### Single Query Test
29+
* [Single query test source](src/main/java/benchmark/DatabaseController.java)
30+
31+
### Multiple Queries Test
32+
* [Multiple queries test source](src/main/java/benchmark/DatabaseController.java)
33+
34+
### Database Update Test
35+
* [Database update test source](src/main/java/benchmark/DatabaseController.java)
36+
37+
### Fortunes Test
38+
* [Fortunes test source](src/main/java/benchmark/DatabaseController.java)
39+
40+
## Test URLs
41+
### JSON
42+
43+
http://localhost:8080/json
44+
45+
### PLAINTEXT
46+
47+
http://localhost:8080/plaintext
48+
49+
### DB
50+
51+
http://localhost:8080/db
52+
53+
### QUERY
54+
55+
http://localhost:8080/queries?queries=
56+
57+
### UPDATE
58+
59+
http://localhost:8080/updates?queries=
60+
61+
### FORTUNES
62+
63+
http://localhost:8080/fortunes
64+
65+
## build
66+
67+
### java's httpserver impl
68+
69+
`mvn clean package`
70+
71+
### robaho's httpserver impl
72+
73+
`mvn clean package -P robaho`
74+
75+
### jetty's httpserver impl
76+
77+
`mvn clean package -P jetty`
78+
79+
## run
80+
81+
`java -p ./target/modules/ -m avaje.techempower`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM maven:3.9.9-eclipse-temurin-24 AS build
2+
WORKDIR /avaje-jex
3+
COPY pom.xml pom.xml
4+
COPY src src
5+
RUN mvn package -q -P jetty
6+
EXPOSE 8080
7+
8+
CMD ["java", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-p", "./target/modules/", "-m", "avaje.techempower"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM maven:3.9.9-eclipse-temurin-24 AS build
2+
WORKDIR /avaje-jex
3+
COPY pom.xml pom.xml
4+
COPY src src
5+
RUN mvn package -q -P robaho
6+
EXPOSE 8080
7+
8+
CMD ["java", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-p", "./target/modules/", "-m", "avaje.techempower"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM maven:3.9.9-eclipse-temurin-24 AS build
2+
WORKDIR /avaje-jex
3+
COPY pom.xml pom.xml
4+
COPY src src
5+
RUN mvn package -q
6+
EXPOSE 8080
7+
8+
CMD ["java", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-p", "./target/modules/", "-m", "avaje.techempower"]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"framework": "avaje-jex",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"db_url": "/db",
9+
"query_url": "/queries?queries=",
10+
"fortune_url": "/fortunes",
11+
"update_url": "/updates?queries=",
12+
"port": 8080,
13+
"approach": "Realistic",
14+
"classification": "Micro",
15+
"framework": "avaje-jex",
16+
"language": "Java",
17+
"flavor": "None",
18+
"platform": "httpserver",
19+
"database": "Postgres",
20+
"database_os": "Linux",
21+
"orm": "Raw",
22+
"webserver": "None",
23+
"os": "Linux",
24+
"notes": "avaje-jex using jdk.httpserver",
25+
"display_name": "avaje-jex",
26+
"versus": "httpserver"
27+
},
28+
"robaho": {
29+
"json_url": "/json",
30+
"plaintext_url": "/plaintext",
31+
"db_url": "/db",
32+
"query_url": "/queries?queries=",
33+
"fortune_url": "/fortunes",
34+
"update_url": "/updates?queries=",
35+
"port": 8080,
36+
"approach": "Realistic",
37+
"classification": "Micro",
38+
"framework": "avaje-jex",
39+
"language": "Java",
40+
"flavor": "None",
41+
"platform": "robaho",
42+
"database": "Postgres",
43+
"database_os": "Linux",
44+
"orm": "Raw",
45+
"webserver": "None",
46+
"os": "Linux",
47+
"notes": "avaje-jex using robaho's httpserver",
48+
"display_name": "avaje-jex-robaho",
49+
"versus": "robaho-httpserver"
50+
},
51+
"jetty": {
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+
"framework": "avaje-jex",
62+
"language": "Java",
63+
"flavor": "None",
64+
"platform": "Jetty",
65+
"database": "Postgres",
66+
"database_os": "Linux",
67+
"orm": "Raw",
68+
"webserver": "None",
69+
"os": "Linux",
70+
"notes": "avaje-jex using Jetty",
71+
"display_name": "avaje-jex-jetty",
72+
"versus": "jetty"
73+
}
74+
}
75+
]
76+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[framework]
2+
name = "avaje-jex"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
urls.db = "/db"
8+
urls.query = "/queries?queries="
9+
urls.update = "/updates?queries="
10+
urls.fortune = "/fortunes"
11+
approach = "Realistic"
12+
classification = "Micro"
13+
database = "Postgres"
14+
database_os = "Linux"
15+
os = "Linux"
16+
orm = "Raw"
17+
platform = "jdk-httpserver"
18+
webserver = "None"
19+
versus = "httpserver"
20+
21+
[robaho]
22+
urls.plaintext = "/plaintext"
23+
urls.json = "/json"
24+
urls.db = "/db"
25+
urls.query = "/queries?queries="
26+
urls.update = "/updates?queries="
27+
urls.fortune = "/fortunes"
28+
approach = "Realistic"
29+
classification = "Micro"
30+
database = "Postgres"
31+
database_os = "Linux"
32+
os = "Linux"
33+
orm = "Raw"
34+
platform = "robaho-httpserver"
35+
webserver = "None"
36+
versus = "robaho-httpserver"
37+
38+
[jetty]
39+
urls.plaintext = "/plaintext"
40+
urls.json = "/json"
41+
urls.db = "/db"
42+
urls.query = "/queries?queries="
43+
urls.update = "/updates?queries="
44+
urls.fortune = "/fortunes"
45+
approach = "Realistic"
46+
classification = "Micro"
47+
database = "Postgres"
48+
database_os = "Linux"
49+
os = "Linux"
50+
orm = "Raw"
51+
platform = "Jetty"
52+
webserver = "None"
53+
versus = "jetty"

0 commit comments

Comments
 (0)