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

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

说明与用途

mouse‑php 通过去除 ORM、使用哈希表路由和单向中间件管道,证明同步 PHP API 能够高效扩展,在 2000 Req/s 时平均延迟为 1.41 ms。

问题

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

结果

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.

工作流

  • 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.

证据

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

来源

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

来源

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

来源

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

来源

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

来源

All benchmarks were executed locally on bare‑metal hardware…

来源

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

来源

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

来源

  • 记录日期: 2026-10-21T05:56:09.964Z