11 ms·
Hi all, Discord engineer here! If anyone has any questions about the post or our experience using React/React Native the team would be happy to answer them!
by mrkcsc 8y ago
Hi all, Discord engineer here! If anyone has any questions about the post or our experience using React/React Native the team would be happy to answer them!
- superplussed 8y agoAwesome post, and it's really impressive what you have managed to build with such a small team! Could you go into more detail regarding your problems with Android? Poor performance of touch events seems like the kind of thing that would make RN/Android unsuitable for most teams, so why does it have such widespread adoption? Any other insights would be great, as I'm planning to start converting my web app to RN in the next months and didn't know Android would be a problem.
- mrkcsc 8y agoSure, When we originally got it running on Android (without the chat view since that component is native in the iOS app) we found that it performed quite poorly due to most of our pages being heavy on data and UI - as well as being very reactive (a typical discord server might have hundreds of permissions, messages and users all changing/updating in real time). React Native is single threaded and while iPhone’s have great single threaded performance, Android phones are more reliant on multiple cores and RN as I understand it mostly can’t take advantage of that. On higher end Android phones the performance was actually fairly acceptable out of the box, but our user base has a lot of gamers who are running very old Android phones from many years ago - and in those situations the lag was unacceptable. For iOS, most users tend to only last one or two hardware generations behind. Additionally, at the time React Native for Android had just been released and there were a whole host of other issues at the time - bugs and lack of Android specific components like the Navigator (which have since mostly been ironed out). Today I think it is possible to build a fast React Native Android application and I would recommend someone starting from scratch do so :). However now the challenge is that we have an existing Native Android app so our users already have a baseline expectation of feature parity and performance. If we switch over we must meet or exceed that bar.
- bulldog13 8y agoWhy do I get feedback on discord, but not Skype for Business ? Have tried 3 different mics of different types and messing with the settings constantly. When I say feedback I mean my speaker output going as input to everyone else.
- a13n 8y agoSeems like something you should bring up with Discord's official support channel. This isn't really related to the article.
- mrkcsc 8y agoI'd suggest reaching out to our CX team (support@discordapp.com) - we really do care and you will get a reply :) I'm not an expect on voice but iirc we do use a different codec than Skype so the audio is not going to be identical however, we have advanced settings in the `Voice and Video` section of the settings that allows you to enable/disable things like Echo Cancellation and Voice Suppression that could be the cause of the feedback.
- connorshea 8y agoAs a user of the iOS app it used to have some admittedly frustrating problems, but pretty much every complaint I had previously has since been fixed, huge kudos on the progress you've made! The only thing left that really bugs me is the fact that you can't paste images from the clipboard into the message field. It's made me change my entire workflow, from copying images to saving them. Sorry to use this as a soapbox for my pet issue, but I saw the opportunity :P
- mrkcsc 8y agoWe are actually starting work on allowing pasting images from the clipboard this week :D So stay tuned! Thanks for the kind words, the team really appreciates it.
- connorshea 8y agoThis makes me so happy, thank you! :D
- mehblahwhatevs 8y ago* I'm curious as to what performance degradation you've seen on Android? * Have you evaluated cross-platform "native-ish" alternatives? (Nativescript, Flutter, etc.) * What does the "lack of 64-bit support" mean for Android?
- saagarjha 8y agoThere's a linked issue in React Native regarding 64-bit: https://github.com/facebook/react-native/issues/2814 https://github.com/facebook/react-native/issues/2814. In short, you can't use 64-bit dependencies.
- mrkcsc 8y ago* Mentioned in another comment, but generally the performance of animations was poor with mixed in with any other kind of UI rendering - particularly on older phones (when we prototyped iOS we really only focused on the latest two generations of iPhones). * This can be worked around by deferring work when doing transitions/animations based on user interaction but at the time we only had a single Android Engineer (myself) and I felt it would be an overly large hurdle to cross. The team is however still interested in trying again some point in the future now that we have more time for it. * The minimum version we support is API level 16 which is quite old and we may eventually bump that to 17. * We have not evaluated any native-ish alternatives mostly due to bandwidth but also because the goal is to re-use our stores/business logic from the desktop/ios clients so we can move faster. * On 64-bit support https://github.com/facebook/react-native/issues/2814 https://github.com/facebook/react-native/issues/2814 it ca be worked around without much consequence but is a consideration as ones application grows in complexity and dependencies.
- nottorp 8y agoWhy does Discord need 2G RAM if you don't restart it regularly? In your defense, it's a cancer that all "modern" apps done in javascript suffer from, but still, why?
- euphidime 8y agoIs Discord really using 2GB of RAM for you? Can you clarify what you mean by regularly? Discord (including all of its helper processes) is only using 190 MB of RAM for me at the moment.
- nottorp 8y agoThe screenshot below was a particularly bad day... but Discord, Skype and Slack (all javascript "applications") compete continously for eating more ram than my actual work stuff. https://imgur.com/a/NrNTDop https://imgur.com/a/NrNTDop Edit: for those who don't want to click, it's a screnshot of the os x activity monitor showing the worst memory consumption, in order: Discord Helper 1.98 Gb, kernel_task 1.67 Gb, Skype Helper 1.58 Gb, Slack 1.20 Gb :)
- Klonoar 8y agoThis is getting really, really old. Modern RAM doesn't work the way people who complain about Slack/et al think it does. The operating system will cull it from other places when it needs it; even a native Cocoa app will not dump memory you're done with until the system decides it needs it for something else, because on the off-chance your app ends up needing it again, it's already allocated. "purge" exists for a reason. It's like when you pull up a StackOverflow answer for "how can I judge how much memory usage my process has?", and the top voted answer is some bash script to determine peak ps, when every other answer tries to explain that that's only one measure of memory and isn't even totally accurate. Furthermore, that nice feature of most modern apps where you're scrolling up rapidly and an image is nice and ready to present? Images are big, especially when we all use retina displays. They take up memory. There was a blog post that went on HN a few months ago but didn't seem to make the front page, wherein the author determined that forcing Electron to dump image cache junk lowers the memory usage substantially. Could Electron & co do better? For sure. Loading an entire browser for a UI does kind of suck. But stop acting like all the stuff that the browser does for you _for free_ is or should be zero-cost. End rant, I guess.
- jamesgeck0 8y agoThe post says, "it’s roughly 1.5s startup delay to load a 15mb bundle on an iPhone X." I've seen startup latency much slower than that on my iPhone SE. In the best case, the application takes about six seconds to cold boot when I tap on a notification. Sometimes it's closer to fifteen or twenty seconds if the app sits on the "connecting" screen for a while. It's difficult to understate how much slower the app feels than everything else on my phone.
- milankragujevic 8y agoSlower storage and slower CPU on the SE? Maybe that is a factor, I'm not quite sure.
- nikanj 8y agoThe X is the most expensive iPhone you can buy right now, and the SE is the cheapest. Too bad engineers practically always have the top-end models, so they don't really have to dogfood the everyday pain of using the slower devices.
- postalrat 8y agoThat creates opportunities for other developers to build a better product.
- StudentStuff 8y agoThat kind of optimization is happening much more on Android than on iOS, the install base of low end devices is much, much larger.
- victoriasun 8y agoActually I don't own an iPhone X :P Our core user base tends to use 6 and above (approx 2 generations behind) and we dogfood regularly with a huge group of beta testers (thousands) with a huge range of hardware. We try our best to make sure the average use case is considered.
- steveklabnik 8y agoI don't have a question, I just want to say that I really have enjoyed using Discord. It's been a pleasure. And I'm traditionally an IRC die-hard. Thanks for all of your work.
- mrkcsc 8y agoThank you! :)
- Vishnevskiy 8y agoThanks! And thank you for helping make Rust awesome.
- daimyoyo 8y agoThis is not related to the post but I have an honest question. I use nitro(and absolutely love it) and I'm constantly getting inquiries about how I use blobs. There are literally 5 accounts I would happily gift a nitro subscription to but dont have the option. When is discord going to allow people to gift nitro to other accounts. It's a huge potential revenue stream and something I would happily engage in if I had the chance to. Thank you for your work. I love discord.
- mrkcsc 8y agoIt's been discussed a lot internally - I would love to gift Nitro to folks myself ala Reddit Gold :) I believe it's something we may eventually take on - just not currently planned - there are a lot of ways we could make the nitro experience better.
- itsyogesh 8y agoThanks a lot for the writeup. We've been using react native for a while now at our org and while we aren't native developers, we are getting along really well. One question that popped up in my while reading the article was would you consider doing the android app in react native if you had to start now ? Or do you still feel it lacks the coherency it has with iOS.
- mrkcsc 8y agoBased on our experience yes I would certainly consider doing the Android side in React Native starting today. While the performance footprint is mostly the same - the ecosystem and feature set around it has improved a ton to the point where I believe you could get it 90% there very quickly. One of my friends has a small startup and they went full React Native as a team of two and they describe the Android side as "free" as in they really just focus on iOS and it 90% of the time it also works fine on Android (they care less about older devices at the moment so they don't spend time optimizing for those). Android inherently will always have challenges due to the vast number of devices and hardware/performance problems but going native isn't a silver bullet either and doesn't shield you from the challenges entirely - it's just a familiar form of pain ;P
- abledon 8y agoWould you guys ever consider using Drab to interact with ReactNative on the frontend?
- Nr7 8y agoWhy on earth don't you have a separate button for emoji on iOS like you have on Android? Having to manually type :emojiname: every time is absurd. Yes, I know it shows a list when you start typing but it's still horribly cumbersome.
- grawlinson 8y agoDiscord Canary on my linux PC is unusable. It "stutters" during scrolling, typing and any form of interaction with it. Is this what's expected from the app?
- jamesgeck0 8y agoIt’s not unheard of for alpha versions of applications to have issues. Does the release version also stutter?
- victoriasun 8y agoSorry to hear that your Canary experience is not great :( Have you tried our stable Discord release? Canary will always have instability to it. If stable Discord still jitters for you please contact us (https://support.discordapp.com/hc/en-us https://support.discordapp.com/hc/en-us) and we can diagnose better.
- Neighbor_ 8y agoNot related to React/React Native, but I was wondering if there was a way to show a users online/idle/offline status through an API call or if there are plans too. I've been using Discord's OAuth and that's been nice, but I what I'd really like is to display that status on my site.
- JaimeThompson 8y agoWhy, starting I think about 30 or so days ago, does Discord start using insane amounts of CPU time when it is started on a system that doesn't have network connectivity? On a Surface 3 Pro, A newer laptop, and a desktop system I have seen this happen. It will just use 20-40% of available CPU unit networking is restored.