Optimisation! The art of making things go fast and doing more with less. I’ve always enjoyed a good optimisation, but over time, I’ve learned to view them with a bit more nuance. Optimisation is not neutral, as my dishwasher taught me.

🐈 The bit about cats

Okay, let’s set the scene first. We’ll get back to optimisations and software but first let me tell you about my cats. I have two, and they’re very adorable and I love them and they’re also getting up there in years. And when your cats get old and you want them to be healthy and you have the money to do it, you might feed them exclusively wet food, as we do. This keeps them hydrated and is generally just better for them. And when your cats get old they might also have sensitive stomachs and require multiple smaller meals, as ours do.

So, two cats, four wet food meals a day = 8 cat bowls. That’s a lot of bowls, and we have that many but we don’t have a lot more than that. Let’s say we have 10 bowls. (I could get up and look but I don’t feel like it and does it really matter anyway? This is all a metaphor to talk about software engineering).

10 cat bowls, 8 used per day.

🍽 On dishwashing

And now we get to the dishwasher. Obviously we need to keep those bowls clean. There are two options to clean them: hand washing, and using the dishwasher. Let’s look at the properties of each.

method process throughput latency water use per-dish notes
hand washing on-demand 1 dish 20 seconds high annoying and makes my hands wet
dishwaser batch easily all the cat bowls in one run 1 hour low not annoying

As you can see, the dishwasher is my preferred method of washing the cat dishes (having marked the alternative as annoying). However, hand-washing is more flexible and lower latency! I can hand-wash a dish at any time, which is helpful when I need to feed the cats but all the dishes are dirty.

📈 Optimising!

Now, here comes the bit about optimisation. There are a few variables at play, and we’re going to try and make some of them go up or down.

  • cat feeding timeliness: feline comfort (also my cats are very annoying when we deviate from the schedule so there’s an element of human comfort here)
  • annoyingness: human comfort
  • water use: let’s be ecological and also save money on hot water
  • soap use: let’s save money on soap

At first, I would tend to run the dishwasher only when it’s full: optimising for water and soap use by only running a full load. But this meant that the cat dishes, which are made dirty at a constant rate, were not cleaned at a constant rate, because the dishwasher loading depends more on what dishes the humans made with our cooking and eating.

This meant that sometimes all the cat bowls were in the dishwasher, waiting for more dishes to be added before it could be run. In this case, to avoid compromise on cat feeding timeliness, I had to do some hand-washing of cat dishes. 😱

So in this scenario, I had optmised for cat feeding timeliness and water/soap efficiency, at the expense of annoyingness. Furthermore, hand-washing is not very efficient on water and soap use, so those were probably not optimal either.

What if we optimise for cat feeding timeliness and annoyingness? Then the answer becomes clear: cat dishes are made dirty at a constant rate. 8 cat dishes per day are dirtied, and can be easily cleaned all at once with the dishwasher. So, if we give up on ensuring a full load of dishes per run, we can always have clean cat dishes and never need to hand wash them!

I decided to run the dishwasher every night after dinner. It’s almost always full or nearly full at that point, so the compromise on energy/water/soap is not too bad, and I no longer need to handwash cat dishes! In fact, this seems to have helped with keeping the high use human-focused dishware clean and available as well!

strategy good on compromise on
full-load dishwasher use with hand-washing as needed timeliness, dishwasher efficiency annoyingness, water use?
daily dishwasher use timeliness, annoyingness dishwasher efficiency, water use?

🐛 Lessons for software and process optimisation

  • remember trade-offs: Rarely are you just optimising. Most optimisations improve some dimensions by compromising on others.
  • pick your priorities: When trade-offs are present, the best solution depends on what variables you want to optimise, and on which you will accept a compromise. For me it turned out to be annoyingness and timeliness that were the most important.
  • reconsider constraints: waiting for full dishwasher load introduces a dependency from cat dishes to human dishes, making this constraint hard to achieve

Nothing groundshaking there really, but I always enjoy the chance to illustrate software engineering concepts with a metaphor! So next time you’re optimising something - think of your dishwasher!

🙃 Other (bad) solutions

With that guidance in mind, we can come up with a few more solutions by reconsidering our priorities or constraints.

  • Buying enough cat dishes to fill the whole dishwasher, and running it only when full. But I don’t want to own 30 cat bowls!
  • Feed the cats from dirty bowls, or not on a schedule. But I want to keep them happy and healthy!
  • Buy disposable cat bowls? Could work, but it’s not very ecological!