benchmarking

  • Upgrading a production application to PHP 7

    Twice the throughput and half the memory, for a migration that is mostly deletions — plus the four behaviour changes nobody puts in the upgrade notes.

  • PHP 7 halved the memory, which changes the pool size

    The upgrade is usually measured in request latency. The larger operational change is memory: PHP 7 rewrote the internal value representation, and arrays in particular use a fraction…

  • Reading EXPLAIN until a slow catalogue query gets fast

    4.2 seconds on 60,000 rows. Following EXPLAIN from a full table scan to a covering index, and why the composite index that existed was never used.

  • microtime benchmarking measures your loop as well

    Wrapping a call in two microtime(true) readings looks like a measurement and is mostly noise: one iteration, no warm-up, and the timing includes whatever the loop and the…

  • A Redis cache layer that does not go stale

    The cache made it fast and made it wrong. Key design, invalidation on write rather than on a timer, and why KEYS is the command that takes the…

  • Redis pipelining removes the round trips, not the work

    A hundred Redis commands issued one at a time cost a hundred network round trips. On the same host that is around a millisecond total; across an availability…

  • Get the peak memory usage of a PHP script

  • Altering a 30-million-row table without downtime

    ALTER TABLE on 30 million rows blocks writes for 40 minutes, and checkout writes to that table. A shadow table, triggers, and a backfill paced by replication lag.

  • Replacing 30 script tags with a Grunt build

    Thirty-one requests before the page could do anything, most of them under 2 KB. Concatenation in a declared order, source maps, and cache busting that proxies respect.

  • Upgrading a PHP 5.3 application to 5.5

    5.3 stops getting security fixes in August. Deprecations first, then the behaviour changes, then the version bump — and an APC replacement that ignores every setting you tuned.