Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The 13% Penalty: Why Synchronous APIs Still Scale Better Than You Think

Description and use

mouse‑php shows that synchronous PHP APIs can scale efficiently by dropping ORMs, using hash‑based routing, and a one‑way middleware pipeline, achieving 1.41 ms average latency at 2000 Req/s.

Problem

Developers believe PHP is inherently slow, synchronous APIs cannot scale, and that performance requires sacrificing developer experience.

Outcome

mouse‑php achieved an average latency of 1.41 ms at 2000 Req/s and maintained 99% of requests below 5 ms up to 15 000 Req/s, demonstrating that synchronous PHP APIs can scale efficiently with low‑level simplicity.

Workflow

  • 1. Strip framework bloat and keep execution linear.
  • 2. Replace ORM with a structured PDO wrapper to avoid hydration tax.
  • 3. Implement associative‑array first routing to bypass regex parsing.
  • 4. Adopt a one‑way middleware pipeline for early exits and context injection.
  • 5. Benchmark with wrk2 on bare‑metal hardware using controlled load profiles.
  • 6. Analyze latency metrics to identify saturation points.

Evidence

I built a lightweight framework to act as a data marshal for my decoupled single page apps…

Source

Traditional MVC frameworks push heavy ORMs… In mouse‑php, I inverted this relationship and completely ditched the ORM…

Source

Industry standard routers rely heavily on complex regex engines… In mouse‑php, the routing engine uses associative array hash lookup first…

Source

Most modern frameworks use an “onion model”… I moved mouse‑php to a strict one way pipeline…

Source

Benchmarking modern HTTP APIs accurately is surprisingly nuanced… I migrated the test bench to wrk2…

Source

All benchmarks were executed locally on bare‑metal hardware…

Source

Using these test parameters, our control run targeted a route that returned a static JSON payload…

Source

At 15,500 Req/s, P99 jumps from 4.53 ms to 11.88 ms…

Source

  • Record date: 2026-10-21T05:56:09.964Z