performance

  • Profiling with a sampling profiler instead of an instrumenting one

    An instrumenting profiler records every function call, which changes the timings it is measuring — small fast functions look disproportionately expensive because the overhead is per call. Sampling…

  • Xdebug on in production is a 3x tax you did not agree to

    Merely loading the extension slows execution substantially even with no debugging session and no profiler running, because it installs hooks into the engine. It ends up in production…

  • webpack-bundle-analyzer before optimising anything

    Guessing what is large in a bundle is unreliable, and the answer is frequently one dependency that pulled in a locale file for every language on earth. The…

  • Load testing with a think time, or the numbers are fiction

    A tool firing requests as fast as it can with no pause measures how fast the server can be saturated, which is not a number that corresponds to…

  • webpack 4 needs almost no configuration

    One line replaced about eighty. The defaults are almost always right, and the cost is that they are invisible when they are not.

  • Measure the p99, because the average hides the incident

    An hourly spike that made every request four hundred milliseconds slower for two seconds moved the average by nine milliseconds and was invisible in every graph anyone looks…

  • Collections lazily, with chunk and cursor

    Model::all() on a table with four hundred thousand rows hydrates four hundred thousand objects and then the process dies, having done nothing. chunkById rather than chunk is the…

  • Bootstrap 4 dropped the float grid

    Two and a half years in alpha, and the grid is flexbox now. The class renames are mechanical; the ones that changed meaning rather than name are not.

  • Cache keys need a version, or you cannot ship a change

    Changing the shape of a cached value means every cached entry is now wrong, and there is no way to clear them selectively without knowing every key that…

  • A circuit breaker before the third-party outage

    A payment provider was slow and the whole site went down with it. A timeout bounds one request; it does nothing about how many are waiting at once.