top | item 47010147

Discord: A case study in performance optimization

75 points| tylerdane | 16 days ago |newsletter.fullstack.zip

50 comments

order

nmilo|15 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.

switz|15 days 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.

tylerdane|15 days 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...

ronsor|15 days ago

One runs on machines we pay for (= costs us money). Another runs on end users' machines (= costs them money).

sourcegrift|15 days 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

candiddevmike|15 days ago

Devs are probably running high end MBPs and don't get to experience the frontend on a potato

bloomca|15 days 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.

saagarjha|15 days 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?

alterom|15 days 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-...

jimmiles|15 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?

ipdashc|15 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?

ronsor|15 days ago

Why would they make their UI less familiar to their target audience?

sourcegrift|15 days ago

Except they, or more precisely speaking -- RGB keyboard/computer case buyers-- are their target audience, low IQ high spenders

groundzeros2015|15 days 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?

jhgg|15 days ago

Cool article :)

hackable_sand|15 days 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

egedev|15 days ago

[deleted]