Published measurement

Inspect the latest canonical Ubuntu run.

Loading benchmarks/latest.json from the published site…

Local fallback: run npm run benchmark for a current measurement on your machine. Use node benchmark/run.js --json for structured local evidence.

Commands and profiles

Select a bounded run.

CommandProfileOutput
npm run benchmark250 measured requests + 25 warmups per scenario, 10 concurrent clients.Readable scenario table.
npm run benchmark:smoke8 measured requests + 2 warmups per scenario, 2 concurrent clients.Short readable verification table.
node benchmark/run.js --jsonStandard profile.One structured JSON document for storage or analysis.
shell · custom measured run
node benchmark/run.js \
    --requests 1000 \
    --warmup 100 \
    --concurrency 25 \
    --json
OptionStandardSmokeContract
--requests <count>2508Measured requests for each scenario; positive integer.
--warmup <count>252Validated warmup requests for each scenario; non-negative integer.
--concurrency <count>102Concurrent HTTP clients; positive integer up to the measured request count.
--jsonoffoffEmit structured result data to standard output.
--smokeoffonSelect the short profile; explicit numeric options take precedence.

Execution model

Exercise the shipped public paths.

StageWhat happensEngineering value
Fixture setupCreates temporary text, binary, and SPA files.Known bytes make response validation exact.
Server startThe parent forks benchmark/server.js; the child creates a public Server instance on 127.0.0.1 with an OS-assigned port.Separate event loops isolate server work from client measurement.
WarmupSends and validates the selected warmup count.Connection and runtime startup occur before the measurement window.
MeasurementThe parent process drives concurrent loopback requests through Node's HTTP client and a keep-alive agent.Results represent actual request, routing, file, compression, and hook work.
ValidationChecks the expected status, headers, and exact response bytes for every request.Each validated response contributes to the latency and throughput summary.
CleanupIPC carries a bounded close handshake; the parent destroys the client agent and removes temporary files.Each run leaves a clean workspace.
Process contract: IPC carries readiness, the selected port, and shutdown state. The harness uses Node built-ins and node-http-server itself.

Public-path inventory

Five validated server workloads.

IDRequest pathAccepted response
static-get-smallGET /small.txt200, content length, exact bytes.
static-head-smallHEAD /small.txt200, content length, empty response body.
static-range-largeGET /large.bin with a byte range.206, content range, exact 64 KiB slice from a 1 MiB file.
spa-fallback-gzipGET /dashboard/settings with HTML and gzip negotiation.200, gzip and Vary headers, exact decompressed SPA document.
dynamic-hookGET /dynamic handled by onRequest.200, JSON content type, exact hook response.

Result contract

Read throughput and the latency distribution together.

FieldMeaningUse
requestsPerSecondValidated measured requests divided by scenario wall time.Compare completed work per second.
latencyMilliseconds.p50Median measured request latency.Understand the common request.
latencyMilliseconds.p9595th-percentile measured request latency.Track slower requests near the tail.
latencyMilliseconds.p9999th-percentile measured request latency.Track the high tail.
durationMillisecondsScenario wall time after warmup.Audit the throughput calculation and run cost.

JSON output also records the package version, generation time, Node version, platform, architecture, and effective request profile.

Comparison discipline

Keep the environment equivalent.

  1. Record the environment.Keep package, Node, operating system, architecture, and request profile with every result.
  2. Control host load.Use the same machine and an idle system for comparable runs.
  3. Repeat the run.Collect several samples and compare the distribution across runs.
  4. Compare by scenario.Review throughput and p50/p95/p99 together for the same scenario ID.
  5. Verify behavior first.Run npm test; the benchmark then validates every measured response again.