Discord: A case study in performance optimization
74 points by tylerdane 2 days ago | 47 comments

nmilo 2 days ago
I find it funny that backend devs will do all this infrastructure work to support billions of real time messages and then frontend devs stomp all over it by making the app take 500MB of RAM and hundreds of ms to take basic actions.
reply
switz 23 hours ago
I agree with you that we should care more about resource usage, but it's a false comparison. Backend devs control where their code runs, frontend devs don't.

You can make more precise decisions when you have complete control over the environment. When you don't, you have to make trade-offs. In this case, universality (electron and javascript) for higher RAM usage. It doesn't seem to have slowed Discord's adoption rate.

Even if they built their desktops apps in native code and UI, they'd have to build a JS website in parallel.

reply
troupo 19 hours ago
> Backend devs control where their code runs, frontend devs don't.

This has nothing to do wih the fact that Discord is a bloated, slow monstrosity.

> Even if they built their desktops apps in native code and UI, they'd have to build a JS website in parallel.

Oh no. The impossibility of building a site that displays text and images

reply
tylerdane 24 hours ago
It's a fair point. I think loss-aversion over React (Native) is to blame.

Their current client stack is: Web: React Desktop: React + Electron Mobile: React Native + Native

Their commitment to React on so many platforms makes it easy to accumulate bloat. Their need to support lower-level features means they can't avoid native code altogether.

I wonder why they stick with it.

My guess is they don't want to add more hires just for this problem

Their 2018 commitment to RN: https://discord.com/blog/why-discord-is-sticking-with-react-...

Their 2025 complications with it: https://discord.com/blog/supercharging-discord-mobile-our-jo...

reply
nwienert 3 hours ago
Their native app actually feels surprisingly good, web less so, it's not a RN thing.
reply
ronsor 2 days ago
One runs on machines we pay for (= costs us money). Another runs on end users' machines (= costs them money).
reply
bloomca 23 hours ago
You can pay to have better/more machines, while you can't do the same with your clients
reply
estimator7292 4 hours ago
But you can tell users their hardware isn't supported and to fuck off until they buy new hardware. Which is the norm.
reply
alecco 24 hours ago
But it affects user experience.
reply
anon7000 24 hours ago
Backend performance issues can grind your system to a halt. It’s basically a requirement for Discord to work reliably.

Front-end performance is not a hard requirement for most end users, unless the app is actually unusable. Discord isn’t that bad compared to some software I’ve used. You have to get beach balls on startup and complete UI freezes for people to really care. If it’s good enough for most people, shaving some MB off the memory usage or small number of ms off latency isn’t important to the business

reply
devmor 24 hours ago
As long as negative experience doesn’t meaningfully impact user monetization, there’s no business incentive for that type of company to care.
reply
sourcegrift 16 hours ago
Given how intelligent people are, I would not be surprised if this is by choice. They probably don't want poor pleba using their software anyway, just those with money to spare
reply
candiddevmike 22 hours ago
Devs are probably running high end MBPs and don't get to experience the frontend on a potato
reply
bloomca 23 hours ago
You can't buy client performance, so it is just more visible. It's not like there are a lot of people with Rust/C++ back ends outside of some very critical pieces.
reply
saagarjha 23 hours ago
Sure you can, you hire people to improve it
reply
bigyabai 23 hours ago
Well, no wonder everyone ships websites.
reply
reassess_blind 23 hours ago
The average Discord user does not care.
reply
saagarjha 23 hours ago
Honest question, does anyone appreciate these “case studies”? It seems like they’re always based on some random quote and they go way in detail on what the various technologies are and how they might possibly apply to the subject in question, but with almost no real insight besides “I think this is how it might work”. What kind of case study is that?! If you don’t have real examples how is this better than just presenting the original source for the quote and Wikipedia links to the various technical terms?
reply
alterom 22 hours ago
>Honest question, does anyone appreciate these “case studies”?

I, for one, do not.

But great that we get into some guy's ideation about how Discord is possibly cool, while it's undergoing a major scandal related to ties to Peter Thiel's surveillance company, Palantir, in the botched rollout of age verification[1].

My personal guess is that appearance of articles that paint Discord in a positive light on this forum (and lack substance otherwise) is simply PR.

[1] https://kotaku.com/discord-palantir-peter-thiel-persona-age-...

reply
saagarjha 21 hours ago
I don't really think your comment is very relevant either, fwiw.
reply
hackable_sand 19 hours ago
Their comment is supremely relevant. The timing is not a coincidence and it tastes awful
reply
saagarjha 15 hours ago
You think this post was written because of the Discord stuff in the news?
reply
alterom 16 minutes ago
>You think this post was written because of the Discord stuff in the news?

What a preposterously audacious proposition: to think that an article that describes Discord as a "a finely-tuned system that delivers speed, scale, and reliability" (that's a goddamn chat app, glorified IRC) and casts Discord in good light, written while Discord is experiencing a major scandal, might not be entirely unrelated to the scandal.

More so when the said article offers no concrete details about Discord, instead wildly extrapolating from a few quotes from executives, making assumptions, and talking about what could have been done, all in a way that might as well have been ChatGPT's output.

Yeah, we think that shifting the focus from "Discord stuff in the news" (which is: forcing ID verification and face scans while having connections to Peter Thiel's surveillance business), something that benefits both Discord and Thiel, is quite a likely reason for glowing technical articles about Discord taking off on HN all of a sudden.

reply
alterom 16 hours ago
>I don't really think your comment is very relevant either, fwiw.

Hmmm, really? Just mentioning the biggest thing in the news involving Discord right now isn't relevant to a post about Discord, huh?

What can I say, you have a peculiar definition of relevance.

reply
saagarjha 15 hours ago
Yes, because the post isn’t about Discord. Hacker News always devalues generic comments like those.
reply
alterom 4 hours ago
>Yes, because the post isn’t about Discord.

I love the mental gymnastics it takes to say that an article titled "Discord: A case study in performance optimization", which describes what Discord is, talks about Discord's architecture, and lauds it as "a finely-tuned system that delivers speed, scale, and reliability" isn't aKsHuAlLy about Discord.

>Hacker News always devalues generic comments like those

First: you are not Hacker News, please don't speak for others. Some people did find my comment relevant. They are just as much Hacker News as you are.

Second: my comment wasn't generic. It pointed out that the timing of this article is conspicuous given the news that, at the moment of writing that comment, were not discussed widely on HN.

Since then, someone has posted the exact link I mentioned: https://news.ycombinator.com/item?id=47021421

So, sorry, but reality disagrees with your assessment of it.

reply
jimmiles 2 days ago
Couldn't they focus some of their creativity on making the UI look less like the inside of a middle schooler's brain?
reply
ipdashc 2 days ago
In what ways does it look that way, if you recall?

I hear this semi-often, but I don't really get it. The base UI of Discord is pretty normal / looks just like every other chat app out there. Is it the ads for nitro and stuff like that were the issue?

reply
ronsor 2 days ago
I think the base UI of Discord is fine, but having used it for almost a decade at this point, the UI has gotten worse. Besides the ads you've mentioned, they've added a lot more clutter (random icons, rarely used features, hidden menus, etc.). When I look at screenshots from 2019, I weep.
reply
ipdashc 22 hours ago
There's a bit of clutter for sure, but I don't find it too objectionable. As the sibling comment mentioned, the super reacts are really annoying, and so are the ads, but it's overall alright.
reply
everforward 5 hours ago
Most of the clutter I would complain about comes more down to Discord making it really easy to bloat a server (and a cultural expectation to do so).

I’m in more than one Discord that has more channels than routine users. Like there are 4 people that use it on at least a weekly basis but there’s a meme channel, a pet photos channel, a news channel, yada yada. Managing notifications is a lost cause because the server owner redecorates the server every other week into new channels and what not.

Profiles have gotten weirdly wild, to sell Nitro stuff. Statuses, emojis for the status, now flairs from a server, profile pictures, etc.

Constant notifications for junk. Nitro is on sale, some game I don’t play has a quest, etc.

It’s fine, but it feels like Discord wants to be more than a carrier for voice and chat and I really just want them to do that. I don’t need “Facebook with VoIP”

reply
mtndew4brkfst 2 days ago
Animated server logos, colorful /gradient and tonally-varied usernames & avatars, the super emoji or whatever they're called, etc all feel like they're pushing more towards Twitch chat than anything else. Which as another commenter remarked, is essentially aligned with their original and biggest target demographic.
reply
logicprog 2 days ago
I like those things tbh. A lot of it helps make things more visually interesting, and other users more distinctive.
reply
ipdashc 22 hours ago
> Animated server logos, colorful /gradient and tonally-varied usernames & avatars

Fair, but all of these things are user controlled. If you're using Discord for work or something, presumably you don't have a bright flashing animated server icon and avatar, your server doesn't have gradient roles, etc.

The super emoji are spot on though, those are fun but were really dumb from the get-go, and waste space in the reaction UI.

reply
stackskipton 24 hours ago
It’s also their method of making money which is locking cosmetics behind subscription or purchases.

Other option would be to limit core features for non paying users.

reply
ronsor 2 days ago
Why would they make their UI less familiar to their target audience?
reply
esafak 24 hours ago
The problem is that a lot of people who are not part of that target audience have to suffer that UI to get work done.
reply
saagarjha 23 hours ago
You’re choosing the gaming chat for your work though
reply
esafak 22 hours ago
I am not; I did not create the communities I am a member of. Dozens of them; none about gaming.
reply
Filligree 22 hours ago
It's the one that works.
reply
anon7000 24 hours ago
Discord is honestly not great for work, but there are lots of other tools. I think they should focus on what’s made them successful, which is gamers and communities.
reply
iwontberude 21 hours ago
They should realize charging people $100/year per person for Nitro and $500/year for server boosts means that they don’t want to be advertised to and have their data stolen.
reply
esseph 24 hours ago
> suffer

Really? :/

reply
sourcegrift 16 hours ago
Except they, or more precisely speaking -- RGB keyboard/computer case buyers-- are their target audience, low IQ high spenders
reply
groundzeros2015 21 hours ago
Whenever I read about these web startup architectures I notice there is never a baseline comparison. They start with an insane architecture and then do heroics to transform it into something a little better.

If you have a fast cgi service inserting a text message into a Postgres database, how many messages do you need until that doesn’t work?

reply
jhgg 21 hours ago
Cool article :)
reply
hackable_sand 19 hours ago
Don't let them fool you

Discord, especially the mobile app, is some of the shittiest, broken software I have encountered. The core protection team is absolute trash at their job

reply
egedev 24 hours ago
[dead]
reply
alterom 2 days ago
[flagged]
reply