Benchmark suite for durable-streams-java using the official upstream @durable-streams/benchmarks.
- JDK 21+ (for Virtual Threads optimal performance)
- Node.js 18+
- Quarkus server running
First time setup:
cd benchmarks
npm installFast in-memory storage for testing and benchmarking raw protocol performance.
Start server:
cd ..
./gradlew :example-quarkus:quarkusRunRun benchmarks:
cd benchmarks
npm install
npm run bench:inmemoryPersistent file-based storage using Virtual Threads + blocking I/O.
Start server:
cd ..
./gradlew :example-quarkus:quarkusRun --args='-Dquarkus.profile=filestore'Run benchmarks:
cd benchmarks
npm run bench:filestoreThe upstream benchmark suite measures:
- Baseline Ping: Network latency only
- Total RTT: Full append + long-poll cycle
- Overhead: Durable Streams protocol overhead
Success Criteria: < 10ms overhead
- Small Messages (100 bytes): Target 100+ msg/sec
- Large Messages (1MB): Measure with high concurrency
- Streaming: Target 100+ MB/sec
Results are saved to benchmark-results.json with statistics (min/max/mean/p50/p75/p99).
Example output:
=== BENCHMARK RESULTS ===
Environment: quarkus-inmemory
Base URL: http://127.0.0.1:4432
┌──────────────────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┐
│ (index) │ Min │ Max │ Mean │ P50 │ P75 │ P99 │ Iterations │
├──────────────────────────┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┤
│ Latency - Total RTT │ '5.23 ms' │ '12.45 ms' │ '7.82 ms' │ '7.50 ms' │ '8.90 ms' │ '11.20 ms' │ 10 │
│ Latency - Overhead │ '2.10 ms' │ '8.30 ms' │ '4.15 ms' │ '3.80 ms' │ '5.20 ms' │ '7.50 ms' │ 10 │
│ Throughput - Small │ '350 msg/s'│ '520 msg/s'│ '425 msg/s'│ '420 msg/s'│ '480 msg/s'│ '510 msg/s'│ 3 │
│ Throughput - Large │ '12 msg/s' │ '18 msg/s' │ '15 msg/s' │ '15 msg/s' │ '17 msg/s' │ '18 msg/s' │ 2 │
└──────────────────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┘
Run both storage backends and compare results:
npm run bench:allThis runs:
bench:inmemory- Tests raw protocol performancebench:filestore- Tests real-world persistent storage performance
Compare the two benchmark-results.json outputs to see the performance difference between in-memory and file-based storage.
Override benchmark settings via environment variables:
BASE_URL=http://localhost:8080 ENVIRONMENT=my-custom-env npm run bench:inmemoryServer not responding?
- Ensure server is running on correct port (default: 4432)
- Check
curl http://127.0.0.1:4432/health(add health endpoint if needed)
Benchmarks timing out?
- Increase Vitest timeout in test files
- Reduce concurrency/message counts for slower systems