Not affiliated with or endorsed by Spotify. Dorion is a separate open-source
project by SpikeHD; it's what inspired me.
I just archived a project I was excited about. This is the story of how it
started, the moment I realized my own numbers were lying to me, and why stopping
felt like the right call.
It started with Dorion
I came across Dorion, an alternative
Discord client built with Rust and Tauri. The idea hooked me immediately: instead
of shipping a whole browser inside the app, it uses the one your operating
system already has. The result is a client that's small and made for lower-spec
machines, with themes and plugins on top
(README, LinuxLinks).
I first saw it in an Instagram Reel that compared the performance of the two
apps side by side, with the main features intact. That combination, a big
difference without giving anything up, is what stuck with me.
And I thought: I want this for Spotify. The official app also carries a
browser around. Why couldn't it be tiny too?
First try: do it properly
I started the ambitious way. My own interface, my own login flow, talking to
Spotify's APIs directly. It worked, in the sense that it was a real client. But
every hour I spent on it was an hour spent rebuilding things Spotify had already
built, for a project whose entire promise was being small.
So I did what Dorion does: I threw most of it away. The new version was just a
native window pointed at open.spotify.com. No login code, no API keys, nothing
to maintain. The whole app came down to a 3 MB file.
That was a good day. I felt hopeful. It looked like a promising idea, so I
started measuring it against the real app.
The first benchmark made me very happy
To prove it was lightweight, I built a small benchmark to compare my app against
the official one on my own machine. The first results came in and they were
spectacular. My app was using almost nothing.
Then I looked closer. My app was using 24 MB. For something that was
displaying a full Spotify web player.
That looked strange to me, so I stopped to work out the best way to isolate the
app's execution, so I'd be measuring the app and nothing else. That's how I got
to the real answer: the benchmark was only measuring one process out of nine. The
rest of the app, the part that actually does the work, was invisible to it.
When your measuring tool is the problem
That was the first of several bugs in my own benchmark, and each one was a little
humbling:
- It wasn't counting most of the app.
- It was so aggressive at cleaning up between runs that it would have shut down every web view on my machine, including ones belonging to other apps.
- On my computer, a decimal comma turned
968,2into9682, so some numbers came out ten times too big.
The uncomfortable part is that the first, wrong numbers looked great. If I had
stopped there, I'd have published a triumphant article about a result that
wasn't real.
The honest numbers
After fixing everything, I ran it again. This time I trusted it.
| My app | Official Spotify | |
|---|---|---|
| Size on disk | 3 MB | 436 MB |
| Time to open | 229 ms | 1031 ms |
| Memory, idle | ~968 MB | ~954 MB |
| CPU, idle | ~5% | ~0.2% |
Two clear wins, one tie, and one loss.
My app was a fraction of the size and opened several times faster. That part was
real, and it felt good. But the memory was the same, and sitting idle it used
about ten times more CPU. For an app you leave open all day, that's the number
that matters.
The reason was simple once I saw it. The weight of Spotify isn't in the frame
around it. It's in the web player itself. My app removed the installer, not the
work.
It also made sense once I looked at how the official app is built. According to
Spotify's own engineering team, the desktop client is a native application that
uses the Chromium Embedded Framework (CEF) to display a web-based interface, and
since 2021 it shares a single TypeScript UI with the web player
(Spotify Engineering, InfoQ).
So I was never replacing a heavy native app with a light one. Both run the same
kind of web interface on a Chromium engine. I swapped the engine, not the work
the interface does.
Deciding to stop
I had ideas to improve it. I could make it back off when minimized, trim
processes, tweak flags. But I could see where that road went: a lot of effort, a
risky amount of testing so the music wouldn't break, and an uncertain payoff. And
it all depended on a website I don't control, which could change something on a
Tuesday and break my media keys.
So I stopped. In the end, the results were too close to the official app. I tried
to look at it as a user would: there was no good reason to pick my version over
the real one as an alternative. The effort wouldn't have paid off for anyone.
I archived the project and wrote down what I'd learned, so the work wouldn't
just vanish.
What I'd tell myself at the start
- Decide what "success" means before you build. If I'd written "idle CPU must be close to the official app" on day one, I'd have known within an hour that I was going to lose.
- Don't trust a result because you like it. The wrong numbers were the good-looking ones. Be most suspicious when it all seems to go your way.
- Know where the cost really lives. I assumed the browser shell was the heavy part. It wasn't.
- Stopping isn't failing. I finished with a working app, honest data, a documented decision, and a much better sense of how to evaluate the next idea.
There are things I never measured, like memory while music is actually playing,
and I'd be the first to say those numbers could change the picture. But the gap
in idle CPU was large and consistent, and I was comfortable stopping on that.
The code, raw data and notes are here:
https://github.com/lucasheartcliff/litespot.
