1
- ```` markdown
2
1
# HTTP Client Benchmark Harness
3
2
4
3
This module contains HTTP client benchmark harness using [ JMH] .
@@ -11,41 +10,52 @@ or measurement time in order to get more reliable data.
11
10
There are three ways to run benchmarks.
12
11
13
12
- Using the executable JAR (Preferred usage per JMH site)
14
- ```bash
15
- mvn clean install -P quick -pl :http-client-benchmarks --am
16
-
13
+ ```
14
+ mvn clean install -P quick -pl :http-client-benchmarks --am
15
+ ```
16
+
17
17
# Run specific benchmark
18
- java -jar target/benchmarks.jar Apache5Benchmark
18
+ ```
19
+ java -jar target/http-client-benchmarks.jar Apache5Benchmark
20
+ ```
19
21
20
- # Run all benchmarks: 3 warm up iterations, 3 benchmark iterations, 1 fork
22
+ # Run all benchmarks: 3 warm up iterations, 3 benchmark iterations, 1 fork.
23
+ ```
21
24
java -jar target/http-client-benchmarks.jar -wi 3 -i 3 -f 1
22
25
```
23
26
24
27
- Using ` mvn exec:exec ` commands to invoke ` UnifiedBenchmarkRunner ` main method
25
- ```bash
26
- mvn clean install -P quick -pl :http-client-benchmarks --am
27
- mvn clean install -pl :bom-internal
28
- cd test/http-client-benchmarks
29
- mvn exec:exec
30
- ```
28
+ ```
29
+ mvn clean install -P quick -pl :http-client-benchmarks --am
30
+ mvn clean install -pl :bom-internal
31
+ cd test/http-client-benchmarks
32
+ mvn exec:exec
33
+ ```
31
34
32
35
## UnifiedBenchmarkRunner
33
36
34
37
The ` UnifiedBenchmarkRunner ` provides a comprehensive comparison between different HTTP client implementations:
35
38
36
39
- ** Apache4** : Apache HttpClient 4.x baseline
37
- - **Apache5-Platform**: Apache HttpClient 5.x with platform threads
40
+ - ** Apache5-Platform** : Apache HttpClient 5.x with platform threads
38
41
- ** Apache5-Virtual** : Apache HttpClient 5.x with virtual threads
39
42
40
- The runner executes all benchmark variations, prints and publishes metrics to CloudWatch.
43
+ The runner executes all benchmark variations, prints metrics to console, and publishes results to CloudWatch metrics for monitoring and analysis .
41
44
42
45
## Benchmark Operations
43
46
44
47
Each benchmark implementation tests the following operations:
45
48
- ` simpleGet ` : Single-threaded GET operations
46
- - `simplePut`: Single-threaded PUT operations
49
+ - ` simplePut ` : Single-threaded PUT operations
47
50
- ` multiThreadedGet ` : Multi-threaded GET operations (10 threads)
48
51
- ` multiThreadedPut ` : Multi-threaded PUT operations (10 threads)
49
52
50
- [JMH]: http://openjdk.java.net/projects/code-tools/jmh/
51
- ````
53
+ ## Prerequisites
54
+
55
+ ### Java Runtime Requirements
56
+
57
+ - ** Java 8+** : Required for running the benchmarks (as specified by ` <javac.target>8</javac.target> ` )
58
+ - ** Java 21+** : Required for virtual threads support (Apache5-Virtual benchmarks)
59
+
60
+ ** Note** : Virtual threads are a preview feature in Java 19-20 and became stable in Java 21. The Apache5-Virtual benchmarks require Java 21 or later.
61
+
0 commit comments