performance

  • The N+1 that does not appear in the query log

    340 queries on a page showing twenty rows, and none of them are slow. Every one is under the threshold, which is why the slow log has nothing…

  • A grid that wraps without a media query

  • A flame graph is faster to read than a call table

    A table sorted by inclusive time puts the entry point at the top and tells you nothing; sorted by exclusive time it hides the structure. The graph shows…

  • A cache stampede, and the lock that prevents it

    An expensive cached value expires under load and every concurrent request misses simultaneously, so forty requests all run the same four-second query at once and the database falls…

  • A queue table is not a queue

    SELECT … WHERE processed = 0 LIMIT 1, and two workers taking the same row. SKIP LOCKED makes the table viable; it does not make it a broker.

  • webpack mode, and the eighty lines it deletes

    A v2 production configuration declared UglifyJs, the NODE_ENV define, module concatenation and the no-errors plugin by hand, and every project copied a slightly different version of the same…

  • Importing only the Bootstrap Sass you use

    The full compiled stylesheet is around 150 kilobytes before compression, and most projects use the grid, some utilities and three components. The order is load-bearing: variables must come…

  • Window functions replace a habit

    8.0 went GA in April and the correlated subquery can retire. The plans before and after, the recursive CTE that replaces a loop, and the upgrade nobody expects.

  • gzip_static serves a file you compressed at build time

    Compressing the same unchanging JavaScript bundle on every request is work done thousands of times that could have been done once. With gzip_static on, nginx serves app.js.gz when…

  • opcache.validate_timestamps=0 needs a deploy that clears it

    Turning off timestamp validation removes a stat call per file per request and means PHP never notices a changed file — so a deploy that does not reset…