Tech
Improving static data performance with metaprogramming
In my previous post Generating static data with Elixir comprehensions I showed how you can use comprehensions to generate static data in your Elixir application. That static data was stored as a Map
in a module attribute and accessible with a function that returns the Map
itself.
When building your application, you probably know how the static data will be accessed. Elixir has various ways of accessing data in a List
, Keyword
, or Map
, and there are big differences in performance based on the size of tha data set. We’ll use the library
benchee
to measure the differences between the built-in access functions and compare that to approaches based on metaprogramming.
Generating static data with Elixir comprehensions
A common requirement in software is to have a static data resource in your application or library. These are typically resources that changes so infrequently that releasing a new version for a data change is fine. Of course you can build these data by hand, but this is error-prone and makes rebuilding the static data more labour intensive. These problems are exacerbated by larger data sets. As good lazy (i.e. efficient) developers we can use code to solve these problems.
Elixir development with Docker
When I start a new project or get setup to contribute to an existing one, the first thing on my mind is: show me the Dockerfile
.
Why?
One of the main purposes of Docker is packaging an application with its dependencies into a portable image that can be run on most any host, thus simplifying deployments. Yet when it comes to development of these applications, Docker is often not part of the picture. Why go through the headache of installing version managers and other dependencies when Docker exists?
Using Pi-hole on multiple VLANs
Pi-hole has been working like a charm on my network for years blocking ads.
I also have it configured with DNS-over-HTTPS using cloudflared
for extra
security and privacy. Pi-hole has a great guide to setting-up DoH.
I recently reconfigured my home network with VLANs to separate the different kinds of devices on my network. There’s my primary/private LAN with the network gear, servers, and my personal systems. Then there’s a VLAN for scary IoT stuff and one for medium-trust devices like Xbox, PlayStation, Apple TV; devices that can access Plex for example but nothing more.
Sun Ultra 24
Spec'ing out a Blackbird POWER9

Recently I’ve been intrigued by non-x86 developments in tech. Over the past few years as Moore’s Law has been breaking down, each new generation of x86 processors has been delivering smaller performance gains. Apple is rumoured to be building ARM-based MacBooks, Amazon is deploying ARM servers, Qualcomm is soon delivering the Snapdragon 8cx ARM processor for laptops. The performance is fantastic and power consumption will allow for laptops with all-day battery life. I’m excited.
Upgrades and dot-zero versions
In my early days with software, I couldn’t wait to upgrade to the latest versions of everything. Service Packs, patches, major new versions. I wanted to be running the latest and greatest versions of every piece of software I could on day zero.
At my first job, our tech lead who had been at this a lot longer than me took a more conservative approach. We wouldn’t upgrade major software like our database or operating systems without at least one service release being available. We wouldn’t adopt new major versions of language platforms until there had been a service release either. I was sometimes disappointed to have to wait for the latest and greatest, but I went along with it.
More than a decade later and I’m now completely on board with this. And there’s no zealot like a convert, so here I am writing about it.
Reducing Raspberry Pi power consumption
Cleaning-up your commit history with git --fixup
I like to keep my git commit history clean and concise. If each commit is a clean package of atomic changes, a larger pull request is easier to review commit by commit. Conversely, if you have a history littered with fixes and changes, reviewing each commit doesn’t work.
git rebase -i
is a great way to re-order commits, drop commits, or merge commits together with squash
or fixup
. The only difference is that fixup
discards the commit message whereas squash
appends it.