Weeknotes 14-18

  • I’ve switched teams at work for the quarter, taking on a tech lead role in a squad that needed a bit of a boost. As a result, I spend most of my days pairing, mobbing and generally in the weeds of programming. The transition was quick and, on reflection, quite exhausting. Spending more than half the day on a group Tuple call pouring over code is quite draining and has decreased my appetite for my usual weekend reflection. On the flip side, I’ve spent the last few weekends hacking on a gnarly WordPress upgrade, digging into stream processing, and even found myself re-watching Simple Made Easy (2012) for the nth time and taking a few pages of notes.

  • The thought of reflecting on flat hunting contributed to my lack of weeknotes these past few weeks. You’ll be glad to know I’ve found a place and move in next week. It’s got a Sky Q dish, so I’ll be able to watch Sky Sports F1 in 4K. It’s also hooked up for gigabit internet via Community Fibre, which I’ll be switching to as soon as my contract or patience with Sky runs out.

  • At work, I’ve been working on reducing asset compilation time for our Rails application. We use Webpack via the webpacker gem, and over time have added various plugins, loaders and custom setup. We’ve also endured a handful of major version upgrades, so the whole thing is a bit crufty with various outdated babel, postcss and browserlist artefacts littering the root of our repository. As it stands, compiling assets takes 8 minutes of our 12 minute build time.

    I spent some time profiling the build to find out what was taking the most time. Webpack has built-in profiling, outputting a stats file readable via the Chrome performance inspector.

    webpack --plugin webpack/lib/debug/ProfilingPlugin
    

    Minification was taking up the most time, at over 60% of the overall build time. Searching for ways to improve the performance of bundle minification, I came across esbuild. esbuild is a JavaScript bundler written in Go focused on performance, quoting some pretty extreme performance gains over alternatives. Configuration was straightforward, using the excellent esbuild-loader to provide a minification plugin that could replace the existing TerserPlugin.

    environment.config.optimization.minimizer = [
      new ESBuildMinifyPlugin({
        target: "es2016",
      }),
    ];
    

    The result was about 3 times faster, reducing our asset build time by over 4 minutes (around 65%).

  • The most recent episode of ATP has an excellent 40-minute section on the situation that unravelled at Basecamp over the past couple of weeks. I’m not going to go into detail here, but I highly recommend a listen if you’ve been following the situation at all.