News for hackers. Stuff that matters.
Re:Evergreen: a React UI Framework built by Segment by sgt on Wednesday October 17, 2018 @12:39AM (#18236164)
I've wondered about React, although I haven't used it myself. I know that the new Reddit was written using React components, and it's very slow. Is that a React problem (i.e. is it hard to write fast web apps) or is it a Reddit problem (or both)?
Re:Evergreen: a React UI Framework built by Segment by chrisco255 on Wednesday October 17, 2018 @01:47AM (#18236412)
It's not a React problem. React runs Facebook, Instagram, and mobile Twitter, for example. But it's possible to build inefficient React implementations. Reddit rebuilt their front end from the ground up. It is possible they have front end issues there. Some flame chart analysis on Reddit's current front end and old front end would reveal the source of the problems.
Re:Evergreen: a React UI Framework built by Segment by matsemann on Wednesday October 17, 2018 @01:53AM (#18236441)
While I agree React isn't the issue here, you chose horrible examples. Loading Facebook on my computer (especially trying to open a chat window) brings my computer to a knee. And using twitter on mobile browser you quickly learn how the spinner looks.
Re:Evergreen: a React UI Framework built by Segment by chrisco255 on Wednesday October 17, 2018 @02:38AM (#18236660)
I haven't had performance issues on Facebook in quite some time. And Twitter works like a charm on my Nexus. I'm wondering how much of your issues have to do with either round trip latency or network issues.
Re:Evergreen: a React UI Framework built by Segment by gog on Wednesday October 17, 2018 @08:42AM (#18238381)
Using FB on my 2014 Macbook Pro is slow as hell and my CPU starts heating up causing the vents to spin up.

It has nothing to do with the round trip latency, the CPU is pegged.

Re:Evergreen: a React UI Framework built by Segment by pier25 on Wednesday October 17, 2018 @08:45AM (#18238400)
The Twitter PWA works fine on my crappy $200 Android phone.
Re:Evergreen: a React UI Framework built by Segment by olavgg on Wednesday October 17, 2018 @11:11AM (#18239822)
Same issue here, I think it takes on average 30 seconds to open Messenger. Facebook is similar. Twitter is also slow.
Re:Evergreen: a React UI Framework built by Segment by ttty on Wednesday October 17, 2018 @12:48AM (#18236194)
React is fast. If you are not experienced in react you'll make a mess because they work against its principles.

To me the Reddit web app is fast, the show part I think is the server side.

Re:Evergreen: a React UI Framework built by Segment by sgt on Wednesday October 17, 2018 @01:37AM (#18236365)
There may be some fast components in the Reddit web app, but I think there must be a valid reason why so many users are switching to the old Reddit (not just because of the way it looks, but due to performance complaints). I just went in and even scrolling through Reddit comments is laggy. Switching to old mode is like day and night.
Re:Evergreen: a React UI Framework built by Segment by wp381640 on Wednesday October 17, 2018 @03:42AM (#18236988)
they're sticking with the old reddit because the information density is much higher. it's a design problem.
Re:Evergreen: a React UI Framework built by Segment by nik736 on Wednesday October 17, 2018 @04:55AM (#18237331)
Not only that, for me in Safari the new reddit barely works and is not loading things very fast or sometimes at all.
Re:Evergreen: a React UI Framework built by Segment by wallawe on Wednesday October 17, 2018 @11:12AM (#18239827)
This could also be due to a poor implementation of event listeners for scrolling, e.g. not throttling, which isn't necessarily a React issue.
Re:Evergreen: a React UI Framework built by Segment by wild_preference on Wednesday October 17, 2018 @12:04PM (#18240384)
Good point.

I built a SPA recently and learned pretty quickly to replace `on('scroll', handler)` with a set-flag-and-sweep-at-slower-interval solution to bring down CPU usage.

While something like React alone isn't slow, building a SPA means you're taking on a lot more responsibility, and there's a lot more things that can go wrong.

Even something like "when user clicks an item, make loader spin until server response, and then render the detail page with the data" can feel much, much slower even though it's not from a clock-time standpoint.

Aside: Using a slow device as your main testing device is a life-changer if you want to catch this stuff early. It's hard to ignore this stuff when you have to feel the pain yourself on every refresh. Good reason to always keep your old phone around.

Re:Evergreen: a React UI Framework built by Segment by goatlover on Wednesday October 17, 2018 @04:02AM (#18237064)
The new Reddit design is often much slower loading the first time than the old one. It's performant after that, but that first load is annoying.
Re:Evergreen: a React UI Framework built by Segment by sgt on Thursday October 18, 2018 @01:38AM (#18246152)
I just had to come back to this comment after testing in a couple of browsers, focusing on Safari and Chrome. Going to https://www.reddit.com/r/whatisthisthing/comments/9oz5sa/wha... and scrolling is OK in Safari but actually pretty laggy compared to old mode. It's definitely not how a modern web site should perform. Testing with Chrome, it was fast in the beginning, but if you scroll up and down for about 15-20 seconds, CPU load goes up and my laptops fan start spinning.

So no, I do not believe reddit's new design is "performant" at all.

One has to wonder - if Reddit's engineers can't get React right (I'm sure they hire smart people), is it really not a problem with React in the end?

Re:Evergreen: a React UI Framework built by Segment by Natela on Wednesday October 17, 2018 @08:10AM (#18238165)
React is not fast, clearly the simple idea of having a virtual Dom is very costly compared to do things by hand. However for a large scale app react makes it more easy to reason about and keep it maintainable, components are far easier to implement, etc...

So for many people, the benefits you get on the development side outweight the performance overhead

Re:Evergreen: a React UI Framework built by Segment by pier25 on Wednesday October 17, 2018 @08:44AM (#18238393)
There is an overhead, but the main problem with the new Reddit is not that it was made in React, but that it's a massive fuckup. Not only from a programming perspective but also design and UX.
Re:Evergreen: a React UI Framework built by Segment by ksrm on Wednesday October 17, 2018 @09:13AM (#18238583)
Given how much they push you to use the app, it's possibly intentional.
Re:Evergreen: a React UI Framework built by Segment by pier25 on Wednesday October 17, 2018 @11:24AM (#18239966)
I should have pointed out that I was referring to the new Redesign of the desktop web. I never use the mobile web.