Uncategorized

  • A database per parallel worker

    Eight parallel workers against one database is eight processes fighting over the same rows, and the failures look like flakiness. The setup cost is what determines whether parallelism…

  • preload is a startup cost you pay once per worker

    Preloading compiles and links classes into shared memory at startup, and the linking is what makes it different from opcache. The measured gain on a typical framework application…

  • Late static binding, and the factory that returns the subclass

    self resolves where the code is written and static resolves where it was called from, and a factory on a base class needs the second. The rule is…

  • posts_per_page => -1 is a promise you cannot keep

    An unbounded query works on the development database with four hundred rows and takes the site down at forty thousand. fields => ‘ids’ is the other half and…

  • Logical assignment: ||=, &&= and ??=

    The three logical assignment operators short-circuit, which means the right-hand side is not evaluated and the assignment does not happen at all when the operator does not fire.…

  • A block style variation instead of a whole block

    A block that differs from a core block only in appearance is a style variation, which is a class name and a stylesheet rule. The variation adds an…

  • Event sourcing is a commitment, not a pattern you try

    Storing events as the source of truth gives a perfect audit log and makes every subsequent decision harder, including the ones that seemed unrelated. The GDPR deletion problem…

  • A mock that records is a stub with a receipt

    A stub provides answers and a mock asserts on the calls, and conflating them produces tests that break when the implementation is refactored. Asserting on a call that…

  • Symfony 6 requires PHP 8 and that is the whole upgrade

    5.4 LTS and 6.0 on the same day, and a deprecation log with four thousand lines nobody reads. The work is all in 5.4.

  • A deterministic moduleId keeps the vendor hash still

    webpack 4 numbered modules in resolution order, so adding one import renumbered everything after it and changed the vendor chunk hash. Separating the runtime is the other half:…