Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI performance regression since v1.3.0 #2648

Closed
2 tasks done
codl opened this issue Apr 30, 2017 · 11 comments · Fixed by #3062
Closed
2 tasks done

UI performance regression since v1.3.0 #2648

codl opened this issue Apr 30, 2017 · 11 comments · Fixed by #3062
Labels
ui Front-end, design

Comments

@codl
Copy link
Contributor

codl commented Apr 30, 2017

Since v1.3.0 the web ui is very slow on chrome for android, on my oneplus 3t it often takes over five seconds to expand a toot or switch to a different tab


  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
@kyzh
Copy link

kyzh commented Apr 30, 2017

I have the same story here on oneplus1, firefox.
I'm also having more firefox crashes, which were non existent before.
Do @ me here or in mastodon.social if you need more data or help to test a PR

@ashfurrow ashfurrow added the ui Front-end, design label Apr 30, 2017
@nolanlawson
Copy link
Contributor

nolanlawson commented Apr 30, 2017

I'm not seeing anywhere near 5 seconds for expanding a toot in Chrome 57 on a Nexus 5X on Mastodon V1.3.2 (more like 1-2 seconds) but I am interested to look into this.

@nolanlawson
Copy link
Contributor

nolanlawson commented Apr 30, 2017

Well I tested this on a Nexus 5 Running Chrome 37, on toot.cafe (currently Mastodon 1.3.2). The first one is switching from the "*" menu to the notifications, and the second is expanding a toot.

screenshot 2017-04-30 16 31 05

screenshot 2017-04-30 16 31 59

A bit impenetrable since most of it is framework code (to me anyway; I'm not experienced with React), but I do recognize some expensive layout/style recalcs (the purple part). Unless it was something that changed in Mastodon's CSS or DOM structure, it looks instead like something may have changed in the React part. I'd have to have a v1.2.2 server to compare against, though.

@codl
Copy link
Contributor Author

codl commented May 2, 2017

if it helps I recorded a chrome dev tools profile of chrome freezing for 35 seconds (!) while switching to the home tl

@Gargron
Copy link
Member

Gargron commented May 4, 2017

I believe v1.3 is where we added a thing that hides some columns instead of unmounting them, when switching between them, which makes them keep their scroll position without a repaint (which was source of a ~100ms lag prior). Could this be it? Storing lots of hidden elements in the DOM instead of unmounting backfiring/crashing on phones?

@arielsbecker
Copy link

Not sure if it helps, but I can confirm this behavior in SeaMonkey 2.4x. In mstdn it eats lots of CPU instead, but the UI is fluent AFAIK.

@nolanlawson
Copy link
Contributor

@codl According to that trace you posted, the browser was blocked on the network for 35 seconds, not the UI:

screenshot 2017-05-04 19 23 36

In particular it was waiting on two requests for /card and /context. May be a server-side problem with chitter.xyz.

@Gargron
Copy link
Member

Gargron commented May 5, 2017

I just realized why the UI would start eating CPU so much. It's obvious in hindsight. Even if the part of DOM in question is invisible, if it's a mounted React component, it will get updated. Having the local timeline, public timeline, etc etc be secretly mounted means they're all getting updated at the same time. This might be reason to revert #2271? Perhaps there is an alternative way to avoid the scroll layout lag?

@nolanlawson
Copy link
Contributor

Is there a way to tell React to de-prioritize those hidden components and then update them using requestIdleCallback? Skimmed the React docs, but it seems the answer is no. In that case maybe it is worth it to unmount for the memory/CPU savings even if it's a bit more expensive to switch views.

@fceschmidt
Copy link

I am noticing this issue too. If I look at the federated TL on hex.bz the CPU usage goes up to 90-100%, and stays there until I close the tab. It's really making my 8 year old notebook unresponsive.

@nolanlawson
Copy link
Contributor

Can you post a trace by any chance?

Gargron added a commit that referenced this issue May 14, 2017
From #2327 - Elephant friend was overlapping with text, oversized in
single column layout

From #2021 - Centered layout goes against design principles, changes
UX for everybody who's already used to the current one

From #2271 - CPU/RAM overusage from keeping columns in DOM (fix #2648,
possibly also #2101)
Gargron added a commit that referenced this issue May 14, 2017
From #2327 - Elephant friend was overlapping with text, oversized in
single column layout

From #2021 - Centered layout goes against design principles, changes
UX for everybody who's already used to the current one

From #2271 - CPU/RAM overusage from keeping columns in DOM (fix #2648,
possibly also #2101)
ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Front-end, design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants