Discord: A case study in performance optimization(newsletter.fullstack.zip)
64 points bytylerdane1 day ago |8 comments
nmilo6 hours 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.
switz4 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.

troupo1 hour 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

tylerdane6 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...

ronsor6 hours ago
One runs on machines we pay for (= costs us money). Another runs on end users' machines (= costs them money).
bloomca4 hours ago
You can pay to have better/more machines, while you can't do the same with your clients
alecco6 hours ago
But it affects user experience.
anon70005 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

devmor6 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.
bloomca4 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.
saagarjha4 hours ago
Sure you can, you hire people to improve it
bigyabai4 hours ago
Well, no wonder everyone ships websites.
candiddevmike3 hours ago
Devs are probably running high end MBPs and don't get to experience the frontend on a potato
reassess_blind4 hours ago
The average Discord user does not care.
groundzeros20152 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?

saagarjha4 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?
alterom3 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-...

saagarjha2 hours ago
I don't really think your comment is very relevant either, fwiw.
hackable_sand39 minutes ago
Their comment is supremely relevant. The timing is not a coincidence and it tastes awful
jimmiles7 hours ago
Couldn't they focus some of their creativity on making the UI look less like the inside of a middle schooler's brain?
ipdashc7 hours 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?

ronsor7 hours 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.
ipdashc4 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.
mtndew4brkfst7 hours 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.
ipdashc4 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.

logicprog6 hours ago
I like those things tbh. A lot of it helps make things more visually interesting, and other users more distinctive.
stackskipton5 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.

ronsor7 hours ago
Why would they make their UI less familiar to their target audience?
esafak6 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.
saagarjha4 hours ago
You’re choosing the gaming chat for your work though
esafak3 hours ago
I am not; I did not create the communities I am a member of. Dozens of them; none about gaming.
Filligree4 hours ago
It's the one that works.
anon70005 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.
iwontberude2 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.
esseph5 hours ago
> suffer

Really? :/

jhgg3 hours ago
Cool article :)
hackable_sand41 minutes 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