performance

  • The temporary table that spilled to disk every time

    A query creating an internal temporary table that exceeded the in-memory limit on every execution, silently. The ratio of disk to memory temporary tables is the diagnostic and…

  • The document that was 400 KB because of one field

    A search document carrying the full product description as both an indexed text field and a stored copy, on a catalogue where descriptions run to several pages. The…

  • A profile taken on the machine that was actually slow

    Three days of profiling locally to explain a production slowdown that did not exist locally. A local profile measures the code and a production profile measures the system,…

  • The 8 ms of autoloading that was a misconfigured classmap

    Eight milliseconds of every request spent resolving class paths, on a deploy that was running the wrong Composer command. Eight milliseconds spread across every request is the kind…

  • The dependency we vendored

    A 200-line package with 41 transitive dependencies, doing one thing, and an advisory in something four levels down that we had never heard of.

  • 140 KB of JavaScript on a page with four interactions

    Four interactive blocks on a page, each shipping its own approach to the same problem. Four independent solutions to the same class of problem is what happens when…

  • json_validate() before json_decode(), and the memory it saves

    Checking whether a string is valid JSON meant decoding it and throwing the result away, which allocates the whole structure to answer a yes-or-no question. The saving is…

  • Sampling traces at five per cent, keeping every error

    Full tracing on a service doing forty thousand requests a day is a data volume problem; sampling uniformly loses the requests worth looking at. Head sampling decides at…

  • Caching by lockfile hash, and the key that never matched

    A cache step with a hit rate of zero for four months, because the key included something that changed on every run. A cache that never hits fails…

  • A flame graph that pointed at autoloading

    Eleven per cent of a request spent in the autoloader, on a machine where the optimised classmap had not been generated. The authoritative flag turns every autoload into…