Performance Benchmarks
NioFlow is built for speed and efficiency. Below are the results of our standard load tests targeting the unauthenticated health check endpoint.
Test Overview
The test was conducted using **k6** against the `task-planner-app` reference implementation. We used a graduated load profile to observe the framework's behavior from zero to peak capacity.
- Tooling: k6 v1.7.1
- Profile: 0 to 100 Virtual Users (VUs) over 2 minutes
- Endpoint: GET /_health
- Hardware: Localhost (Standard Developer Workstation)
Results Matrix
| Metric | Value | Notes |
|---|---|---|
| Throughput | 501.12 req/s | Sustained under peak load (100 VUs) |
| Median Latency (p50) | 1.52 ms | Minimal framework overhead for routing |
| p95 Latency | 47.75 ms | Efficient queue management |
| p99 Latency | 74.62 ms | Queuing delay at max worker capacity |
| Success Rate | 99.84% | High reliability under saturation |
Code Coverage (JaCoCo)
We maintain a rigorous testing standard using JaCoCo to ensure all critical paths in the framework are validated. Our test suite runs 271 tests as part of the CI pipeline.
| Package / Scope | Instruction Coverage | Branch Coverage |
|---|---|---|
| Global Baseline | 83.44% | 71.69% |
| io.github.jhanvi857.nioflow.middleware | 94% | 83% |
| io.github.jhanvi857.nioflow.protocol | 94% | 85% |
| io.github.jhanvi857.nioflow.routing | 93% | 87% |
Technical Analysis
Efficiency and Overhead
The median latency of **1.52ms** indicates that NioFlow's NIO-based request parsing and routing engine is extremely lightweight. The framework does not hide complexity behind heavy reflection, allowing for direct and fast request resolution.
Scaling Limits
At 100 concurrent VUs, the server reached the limits of its default worker pool (64 threads). This is visible in the jump between p50 and p99 latency, which is caused by requests waiting in the internal 1000-slot queue. The 0.16% error rate occurred when the OS-level listen backlog was momentarily saturated during peak concurrent connections.
Reproducing the Results
You can run this test yourself using the provided k6 script in the repository root.
1import http from 'k6/http';2import { sleep } from 'k6';34export let options = {5 stages: [6 { duration: '30s', target: 50 },7 { duration: '60s', target: 100 },8 { duration: '30s', target: 0 },9 ],10};1112export default function () {13 http.get('http://localhost:8080/_health');14 sleep(0.1);15}
1k6 run load_test.js