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

MetricValueNotes
Throughput501.12 req/sSustained under peak load (100 VUs)
Median Latency (p50)1.52 msMinimal framework overhead for routing
p95 Latency47.75 msEfficient queue management
p99 Latency74.62 msQueuing delay at max worker capacity
Success Rate99.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 / ScopeInstruction CoverageBranch Coverage
Global Baseline83.44%71.69%
io.github.jhanvi857.nioflow.middleware94%83%
io.github.jhanvi857.nioflow.protocol94%85%
io.github.jhanvi857.nioflow.routing93%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.

load_test.js
1import http from 'k6/http';
2import { sleep } from 'k6';
3
4export let options = {
5 stages: [
6 { duration: '30s', target: 50 },
7 { duration: '60s', target: 100 },
8 { duration: '30s', target: 0 },
9 ],
10};
11
12export default function () {
13 http.get('http://localhost:8080/_health');
14 sleep(0.1);
15}
Run Command
1k6 run load_test.js