21 ms·
Slack using React Dev Build in Production
- phpnode 9y agoSurprising given that Slack's performance is something people regularly complain about
- micael_dias 9y ago"We use the dev build of React. It makes it easier for us to debug issues our customers might be experiencing. " Is it that hard to debug the production build?
- Griever 9y agoI wonder if they were for some reason unable to emit a sourcemap of their js bundle. Unless they are doing something special here, that should be sufficient for debugging.
- jchw 9y agoThat really does explain why the RAM usage is so damn bad. Comparing it to Discord for example is night and day.
- nilidah 9y agoI've pretty much resorted to using slack in my browser. It all runs so much better.
- jchw 9y agoActually that is exactly what I'd been doing. I recently upgraded to 32 GB of RAM and now the desktop app is usable again, but obviously this is still not even reasonable.
- josteink 9y agoWTF. I remember running a network of 10+ servers and worker-machines on a 4GB hosts not many years ago. And now you can't run a "modern" chat-app without having 32GBs of ram? You know what? I'm happy with IRC. weechat uses maybe 28MBs and runs stellar. Maybe you should just consider that the tools you are using simply are flawed and move to something proven instead?
- freehunter 9y agoNot true. Slack does not take 32GB of RAM to be usable, more likely the rest of his tools take 30GB of RAM. My laptop only has 8GB of RAM and I have Chrome and Firefox open and active while using Slack. Slack has been open for a couple of weeks and is using less than 500mb of RAM on my machine.
- jchw 9y agoThis is correct- my daily environment usually involves multiple VMs and a Docker Compose setup, either a JetBrains IDE or Visual Studio Code, Chrome with some reasonable number of tabs open, Slack, and a few utilities. To further illustrate the reason why this sounds insane, before I was at 32GB, I was at 8GB, and conserved RAM by running Linux with an extremely lean setup (i3 + st + Chrome.) Now I have plenty to spare, and I'm using a much more rich environment. So yeah, it is a little more complicated than just "Slack needed 32GB" - in fact, and thankfully, even my whole stack fits comfortably. It's what I upgraded from that it didn't work well on.
- bathtub 9y agoOnce you tried Discord you wonder why people are still using Slack. Btw, Discord also surpassed Slack in traffic on SimilarWeb.
- empath75 9y agoDo you use discord at work?
- tosh 9y agoDiscord feels very responsive and lightweight. Anyone knows what their stack looks like?
- marcelfahle 9y agoElectron
- TkTech 9y agoThey have some fantastic dev blogs[1]. Their backend seems to mostly be elixir. 1: https://blog.discordapp.com/tagged/engineering https://blog.discordapp.com/tagged/engineering
- thejosh 9y agoElixir for the backend, they have around 5 million concurrent users.
- notamy 9y agoElixir for the backend as others have said, and the frontend is React on Electron.
- lmm 9y agoI do for outside-asking-for-help. At my current client internal communications have to be self-hosted so neither Slack nor Discord is an option; if I were still at the startup where I worked previously (where teams chose their own tools) I'd certainly be pushing Discord.
- 9y ago
- andy_ppp 9y agoMore evidence of my theory that the worst solution for the majority always seems to win right now...
- bantunes 9y agoThat's short-sighted. Electron sucks, but the fact people use it means there's a lack of proper, easy solutions for multiplatform development. Companies will always take the easy path because capitalism. It's up to us (native toolkit devs) to make the easier path better.
- detaro 9y agoThe tweet discussed is about their web version
- Royalaid 9y agoI believe this is a response saying that electron made cross platform easy but at the cost of performance. Native clients still aren't as easy to build as html+css+js and the barrier to entry or cost to maintain is too high vs wrapping the web app you already built.
- nottorp 9y agoBut they don't have a desktop version. Their so called native apps are html in a browser.
- swiley 9y agoBundling an X11 server and writing your app in Motif/Lesstif would be easier and less resource intensive honestly. Is there a platform out there that has no X server?
- JD557 9y ago>Is there a platform out there that has no X server? XQuartz on Mac OS X sucks (maybe it's just Inkscape though) and I'm not sure if there's decent Windows support. Qt might work, though.
- tosh 9y agoAtom and Slack often get critiqued for their use of an HTML5 stack. I'd also like better performance when it comes to startup time, memory usage and responsiveness regarding interactions (I'm using a 12" Macbook) but the stack is so useful and universal that it is here to stay and worth figuring out how to get to great performance (similar to how Emacs figured out how to work around slow startup). Are there examples for HTML5 apps that manage to have great performance? Are there inherent limits?
- aczerepinski 9y agoVS Code performs well.
- lucideer 9y agoI'll second this. There's been articles on HN specifically about how slow VS Code is, particularly the one about rendering cursor blinking, and of course anything running on Electron will never compete work the likes of vim, &c. However, as Electron apps go, I've found it noticeably faster and less resource intensive than any others. Slack in particular is comparatively terrible, as was Atom in the past (people have said it's improved but I've not felt the need to try it again recently)
- porkloin 9y agoI've turned my vim into a monstrosity with plugins in the past - believe me, it's possible to make your vim just as laggy :)
- marcelfahle 9y agoDiscord is pretty snappy, even with tons of users..
- moron4hire 9y agoIt's pretty buggy, though. On Windows, at least once a day it resizes down to a window only big enough to hold the X button to close the window. And it drains the hell out of my battery on Android.
- hamburglar1 9y agoSpotify was also doing this until very recently
- therealmarv 9y agocool, but I still get very high CPU when a gif from giphy is running in background macOS Slack app!
- deleted 9y ago[deleted]
- Androider 9y agoThe performance difference between dev and prod builds of React is significant in my experience. In tests of an animated interface (fairly heavy app otherwise as well), a prod build did 2-3x the raw FPS of the dev build. I can't really imagine what type of benefit they believe they're getting. Your error tracking system does re-assemble the stack from a out-of-band delivered sourcemap, even in prod, even with multiple versions deployed simultaneously... right? Like any decent error tracking system such as Rollbar or Sentry will do out of the box. Tell me you didn't build your own and can't even unwind a production error trace.
- deleted 9y ago[deleted]
- badthingfactory 9y agoReact dev builds are terribly slow at rendering large lists. Open Slack and scroll up for about a minute. It becomes unresponsive very quickly. I don't understand how deploying React's dev build would help anyway... Do they regularly run into bugs where they need to step into React code?
- TremendousJudge 9y agoscrolling up also makes CPU usage spike on chrome (and by extension, on the electron app). This doesn't happen with Firefox
- deleted 9y ago[deleted]
- conradk 9y agoHow is this absurd? I've had problems debugging minified Javascript in production too. So from my point of view, this seems like an appropriate response.
- morley 9y agoThere are ways to debug minified JS in production, sourcemaps being one of them. In addition to the speed difference, there's a significant payload size difference: something like 1.5+MB for the dev build, vs 70kb for the production build, last time I checked.
- conradk 9y agoSourcemaps have the drawback that you actually need to generate them first. Sometimes, getting all of the tooling together is teedious. And about the size: if the JS file is cached properly, downloading 1.5mb once doesn't seem like a huge issue, especially for something like Slack where only desktops use the web client (most mobiles probably download the Slack app). I don't know if this was the case here though.
- erikpukinskis 9y agoIt does show a little of React's dark side though. It's worth asking... Why would Slack need to debug into their view rendering library on customer machines? It's not their code that's made accessible here, it's React's. React introduces a layer of indirection into your rendering. Rather than saying "draw a profile pic" and then "a profile pic means these DOM manipulations", with React you add another layer: "hey, oracle, what does the whole page look like this now, and what DOM manipulations should we do to get there?" It's like having an AI look at your code and decide how it should actually run. Very cool, very futuristic. Not convinced it's a practical decision. Putting something like that in your app means for a much more complex debugging process. It always seemed like the React team was trying to solve a really really hard problem in order to avoid solving an easier problem a bunch of times. Which is classic programmer thinking, and generally a good strategy. But I wonder if it's good for us in the end. The principle you could adopt, which would make React a bad choice, is something like "solve one hard problem if it means you can avoid solving a lot of easy problems, but only if you're solving those actual small problems in bulk. If you're only solving a subset of them, you're going to cause problems for yourself later." Which DOM queries and manipulations make sense? Is React actually answering that question for you, or is it mashing the buttons until it works?
- jbg_ 9y agoI gave up on the Slack desktop client after regularly finding it using 3GB of RAM for no obvious reason. Switched to the browser client but found it buggier and needed to be refreshed periodically due to becoming so slow that there was a noticeable delay on keypresses. Now I'm using Slack via XMPP using Pidgin and things are much, much better.
- GrinningFool 9y agoWould this be a factor in Slack's consistent 20% CPU usage when it's idle? (electron app/linux)
- phatbyte 9y agoSomeone needs to explain Slack what sourcemaps are and what they are used for ;P
- deleted 9y ago[deleted]
- tbrock 9y agoThis makes absolutely no sense. In no way would the debug output help them remotely. Hopefully the visibility will now cause this to get fixed.
- jakef 9y agoYou're all looking at this from a dev perspective ... look at Slack's customer base. Slack Enterprise is expensive for a messaging service, and one of their main selling points is support and reliability. When a huge customer reports a breaking bug they need to resolve it ASAP, turnaround time is probably the number-one priority.
- loganekz 9y agoThe Wall Street Journal [1] also does this. [1] https://www.wsj.com https://www.wsj.com