Optimize for developer cycles, not CPU cycles

submited by
Style Pass
2023-03-15 22:00:12

Performance in software development matters less than you might think. I bet that you waste plenty of CPU cycles and memory for zero good reasons somewhere you aren't looking at and wouldn't look at by intention.

Today I had a talk to a fellow developer who argued that binary encoding is faster than textual. He isn't wrong! Binary encodings mean less work to the CPU. The talk was about an application that received messages of around 100 bytes once a second from around 20 to 30 IoT devices (not becoming more in the foreseeable future) via MQTT.

For a today's PCs (2023) that's a piece of cake - even for the weakest ones. The application does more than receiving those messages but still it's literally nothing.

The much bigger problem is that binary encodings lack a lot of standard tooling. Look at all the standard UNIX utilities like sed, grep, cat, and many more that you just lock out of your toolbox with binary encodings.

You lose the inspectability of messages and network traffic with tools like wireshark when things go wrong or you need to find bugs. When a stream of data is text you just look at it and most likely you can make sense of it. Not with binary, sorry! UNIX has the philosophy "text is the universal protocol" for good reasons.

Leave a Comment