2026-W16

2026-W16

Starting Over (On Purpose)

At some point this week, I decided to get rid of everything I had been building around improving some aspect of PHPSandbox.

It had grown into something quite complex, and I wasn't even sure I wanted that level of complexity anymore. Part of it came from how easy it is to generate code quickly with LLM-assisted workflows. You move fast, you try things, and before long there's a lot of structure built around ideas that might not even be necessary.

Given the results I was seeing, it didn't feel right to keep going in that direction. So I stashed everything and chose to start over.

Strangely, that reset felt like progress.


Finding the Real Bottlenecks

The good thing about going through all of that was clarity. I could finally see where the actual bottlenecks were.

Storage creation stood out immediately. It has to be done fresh each time, and that alone adds noticeable delay. Then there's the container lifecycle. In some cases, containers get started twice, once during bootstrap and again during normal startup, which makes everything feel heavier than it should.

Scheduling was another issue. Sandbox scheduling across worker servers wasn't balanced well, so loads would pile up unevenly. Some machines would be busy while others sat relatively idle.

None of these were new problems, but seeing them isolated made them easier to approach.

So this week, I focused on solving them one at a time. Slowing things down, narrowing the scope, and just working through each piece.

That shift alone made a difference.


A Small Discovery That Changed Everything

One of the more surprising moments came from something I thought I had already done.

PHPSandbox has been using BTRFS for a while, and I believed I was already snapshotting template storage. It turns out I wasn't.

That explained a lot.

Copying template storage had been taking around 7 seconds for standard templates like React or Vue. It always felt slightly off, but I never questioned it deeply enough.

Once I actually implemented snapshotting properly, that operation dropped to milliseconds.

It was one of those quiet improvements that completely changes how the system feels. No big redesign, just doing the right thing in the right place.


A Side Idea at Work

Alongside all of this, I started exploring a small idea at work.

We've been building Cube queries in a lot of different ways across the codebase. Everyone does what works for them in the moment, which leads to a lot of scattered logic. I ran into this directly last week while working on something that required heavy query manipulation. Checking dimensions, removing filters, inspecting structures, it was all very manual.

That got me thinking about a more structured approach.

Cube exposes metadata that describes everything: measures, dimensions, time fields, data types. There's a lot of useful information there that we haven't really been leveraging.

So I started building a tool that reads that metadata and generates TypeScript types from it. The idea is simple: instead of constructing queries freely and then validating them later, you build them in a way that is type-safe from the start.

You get autocomplete. You get immediate feedback if something is wrong. Field names, filters, allowed structures, all enforced at build time.

It also means we can reduce all the scattered manipulation logic across the codebase and move toward something more consistent.

There's also a longer-term benefit. If we ever move away from Cube, having this layer in place makes that transition easier.

I've been working on it quietly, but I'm hoping to demo something to the team next week and get their thoughts. It already feels useful to me, which is usually a good sign.


A Quiet Week

Outside of work, this week was relatively uneventful.

There were a few personal things going on, but not things I can really put into words yet. So most of my time was spent indoors, working, thinking, and just letting things settle.

Still, it felt like a good week.

Not loud or dramatic, but steady. The kind where small decisions, like starting over or focusing on one problem at a time, end up making a bigger difference than expected.


Till next time,

Bosun