changelog 002

Not much happened the past few weeks. Let's not give up on this series after a single post though.

Sushi

Last christmas I've got a sushi course as a present from my sister. It got delayed a bunch because of COVID, but I finally went two weeks ago. Never made sushi before, it was a lot of fun. We made a bunch of maki rolls and ate it all with family for dinner. I was surprised we actually managed to make something tasty. Must be all the love we've put in.

Jiro Dreams of Sushi is a documentary about Jiro Ono, a sushi master from Tokyo regarded as one of the greatest of all time. He's been making sushi for almost 70 years. That's more than twice longer than I've been alive. His restaurant is still located at a Tokyo subway station. No desire for fame or wealth in Jiro. Making the perfect sushi is all that matters.

I don't know if there is such a thing as a meaning of life. But mastery of something is a good candidate. I have a lot of respect for people who are able to dedicate their whole life to a single thing. Doesn't really matter what the subject is. Can be as trivial as being the best making sushi. Or playing tetris. It's the dedication that counts.

Clockwork 5

September days are passing by fast and with each day it's less likely I'll hit the release date. Kinda funny, I was writing how on track I am in the last post and then did very little for the next three weeks. Once again I forgot that the last 20% of the work takes 80% of effort.

On the bright side, I've managed to get the client-metrics and toolbar a bit more polished and merged. I wrote more about those the last time. You can find the browser component in the new clockwork-browser repo. I will also publish on npm soon.

I want to make the new features as easy to use as possible. Npm installation is a given, but I also wanted a cdn hosted option. So you can just drop a <script> tag into your html and be done with it. After a quick google search I've discovered jsdelivr.com. Turns out, any file ever published on GitHub is automatically available via their cdn. No registration, no setup. The best UX is often no UX at all.

Anyway, I'll try to get the first beta tagged in the next few days. One obvious thing I've learned is, there's always a next time. Whatever ideas happen to not make it into 5.0 will be revisited for future releases.

Terminate

Another small improvement I've made recently is moving part of Clockwork processing to a terminate callback.

What is a terminate callback? Php has this handy function called fastcgi_finish_request. Calling this function will immediately send the response to the client, while the script continues running. This is what a terminate callback in Laravel does. This way you can run some expensive code without affecting the response time.

At the end of the request processing, Clockwork needs to serialize all the collected data into json and write it out to the filesystem. This can be pretty expensive if you have enough data. IO operations are notoriously slow. By moving this part of Clockwork processing to a terminate callback we can cut the overhead Clockwork has on your response time up to half.

As the function name suggests this works only for fastcgi (eg. php-fpm). If you are somehow still running php as an Apache module, no fun for you. Please don't do that. Also keep in mind that the php process can't accept new requests while the script runs. This is no replacement for a queue or other means to offload expensive code.

Client-work

It started with a simple feature request. To show a notice when a user visits the website with an unsupported browser. Somewhere along the way things took a turn for the worse. It was decided we still need to support IE11 and I was sent on a week long quest make it so. But that's a story for another time.

Instead, here are some random tidbits I've learned in the process:

Music

Every morning when I turn on my Mac, I immediately put some music on. I need to have music playing at all times. I guess you can call me passionate about music. Lately I've been listening to a lot of $uicideboy$, Elliott Smith and surprisingly some ambient electronic music.

The Fvck_kvlt feature on this song is my favorite piece of music at the moment. It's the second part by the way. The song is in czech and slovak, so you probably can't understand. It's about sadness, depression and having to deal with your own problems.

Another great new music I found is this pop musician daine. I don't even remember where I Shazam-ed this song, but it's awesome. And so is her other single.

...

Thanks for reading. You can also read the previous update. Here will be a link to the next one announcing Clockwork 5 beta hopefully.

—its