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

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

Описание и применение

mouse‑php демонстрирует, что синхронные PHP‑API могут масштабироваться эффективно, если убрать ORM, использовать хеш‑таблицы для маршрутизации и упрощённый односторонний middleware, достигая 1,41 мс средней задержки при 2000 запросах/сек.

Задача

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