Skip to content

Performance Spec ​

Overview ​

This spec defines the performance benchmarks, throughput targets, latency budgets, and resource limits that UVHTTP must satisfy. All measurements are taken on the reference benchmark host.

Reference Benchmark Host ​

  • CPU: AMD Ryzen 7 5800H, 12 cores
  • OS: Linux 6.17.13-2-pve
  • Compiler: GCC 11.4.0 Release build (-O2 -DNDEBUG)
  • Allocator: System allocator
  • Test tool: wrk 4.1.0
  • Test duration: 10 seconds per run
  • Server: built-in test_performance_e2e

Throughput Requirements ​

ScenarioConnectionsMin RPSTarget RPSNotes
Low concurrency1018,00019,887P50 < 0.5ms
Medium concurrency10018,00019,834Flat vs low
High concurrency50018,00019,810Flat vs 100
Extreme concurrency100016,00018,518Graceful degradation
JSON endpoint10017,00019,451
Large response 1KB10017,00019,524
Socket errorsAll00Zero tolerance

Latency Requirements ​

PercentileLatency Budget
P50< 5ms
P90< 10ms
P95< 15ms
P99< 25ms

Memory Requirements ​

MetricBudgetNotes
Static library size< 300 KBStripped Release build
Per-server instance< 512 bytesPlus per-connection allocations
Per-connection< 4 KBRequest + response + buffers
Steady-state RSSFlatNo growth under sustained load
Cold start< 500msFirst byte after launch

Long-Run Stability ​

Under sustained load (100 connections, 60+ seconds), the server's RSS must not grow. Measured with scripts/performance/long_run_memory.sh.

Optimization Features ​

FeatureStatusImpact
Keep-Alive connection reuseActive~1000x vs per-request
O(1) route lookup (trie)ActiveEliminates linear scan
LRU cache for static filesActiveReduces disk I/O
Zero-copy sendfileActive50%+ CPU reduction for large files
Direct libuv callsDesignNo abstraction layer
Compile-time feature selectionActiveNo runtime overhead for unused features

Test Requirements ​

  • Performance regression test on every PR (via CI)
  • Benchmark results must be reproducible
  • Historical baseline stored in docs/performance/baseline-history.json
  • RPS degradation > 5% from baseline must be investigated

Released under MIT License