Closed Bug 1277206 Opened 9 years ago Closed 3 years ago

Performance degradation in heavy CSS / Javascript interactive text.

Categories

(Core :: Graphics, defect, P4)

50 Branch
defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact low

People

(Reporter: jgroland, Assigned: bas.schouten)

References

()

Details

(4 keywords)

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID: 20160531030258 Steps to reproduce: 1) Login 2) Performance is decent. 3) Begin manipulating rows in interactive event table. 4) Double clicking to open pop windows and edit drop down menus / saving input. 5) The longer I do this the longer it takes Firefox to do the same task again. 6) Continues until Firefox is too slow to get work done. Actual results: I get heavy page stuttering and freezing. When in other tabs in same browser session even typing text into search bar will pause and then catch up. Performance on this same page in Blink based browser does not seem effected nearly as much. Expected results: Things should flow smoothly when hovering over each row. Clicking and opening pop windows should take the same amount of time each time. No stuttering when scrolling through hundreds of table rows. And saving of changed input should not take progressively longer.
Component: Untriaged → Layout
Product: Firefox → Core
Keywords: css-moz, polish
Whiteboard: similar to Bug 1155998
Priority: -- → P4
Flags: needinfo?
Looking at the profile posted in comment 1, a good chunk of time is being spent by the uBlock add-on. It's sending sync IPC messages to the parent process. If you disable uBlock, does performance seem to improve?
Flags: needinfo? → needinfo?(jgroland)
I am in the process of testing with no add-ons.
Functionality of the events page is still laggy on scrolling, and selecting rows. Although there may be a slight improvement. The tickets page has improved quite a bit since disabling ublock. But there still is slowness when saving changes and on rows updating with changed information.
Attaching performance profiles for using both pages without addons.
Whiteboard: similar to Bug 1155998 → \
Whiteboard: \
The page is taking around 130ms to paint. Is it possible for you to save a copy of the page using "Save Page As" and attach it to the bug?
Whiteboard: [nightly-community]
Attaching both saved pages (Events and Tickets). Didn't know if I needed them separately since they probably are functioning with the same resources. I see a lot of JavaScript!
Adding to jrmuizel's radar - the slow-painting page has been attached.
Flags: needinfo?(jmuizelaar)
I also failed to mention that this site is also on 15 second refresh timer which is very important for seeing new events happening in our monitoring environment. Randomly it seems that the events page will get stuck at the 15 second mark and never refresh. The page does not seem to lock up or have a script error and outside of having the timer stopped at 15, the page is still responsive. It just makes us have to reload the page entirely to get it working again, and really defeats the purpose. Other browsers appear to not have this issue according to other employees so they switched from Firefox. Not sure how I would catch this issue in the act since it is random as far as I can tell.
Keywords: perf
OS: Unspecified → All
Hardware: Unspecified → All
(In reply to Mike Conley (:mconley) - (needinfo me!) from comment #11) > Adding to jrmuizel's radar - the slow-painting page has been attached. Should that bug be moved from the UNCONFIRMED status to the NEW status?
Version: 49 Branch → 50 Branch
Whiteboard: [nightly-community]
Submitting proper performance profile from Gecko Profiler addon instead of nightly dev tools. This profile is for the page with the most issues (also note near the end, the page was refusing to do its 15 second refresh of events): https://cleopatra.io/#report=a9ae4a3e9288e2def8af1daabeb56a44b0d3e3ce
Submitting proper performance profile for tickets page as well (this time performance was very spotty again): https://cleopatra.io/#report=e58634bdd1732e60a0534caaf62fa8b4ff1b8c8b
Those profiles don't have proper symbols. Was this done with an official Nightly build?
Yes, official Nightly channel.
It looks like our symbol server was broken and so that's why the profiles weren't getting symbols. It has now been fixed. Can you get a new profile?
Flags: needinfo?(jmuizelaar)
These are much, much better! Thank you Jesse!
(In reply to Jesse Roland from comment #19) > New profile for events page: > https://cleopatra.io/#report=13edc1251355284b996c3242d60d47760653075f This one doesn't seem to have worked. Can you try again. Sorry about the unreliability here...
Events page profile that should be good: https://cleopatra.io/#report=5b0dbf0af23a649a0720833e5c3ce55665e8a010 a note: this page froze and would not do its normal 15 second refresh so I had to reload the page. So it is a good example.
(In reply to Jesse Roland from comment #23) > Events page profile that should be good: > https://cleopatra.io/#report=5b0dbf0af23a649a0720833e5c3ce55665e8a010 > > a note: this page froze and would not do its normal 15 second refresh so I > had to reload the page. So it is a good example. For this one, it looks like uBlock's content policy code is causing sync messages to be sent to the parent, which is blocking the content process. If you disable uBlock, do things improve?
Tried this with you up in comment 3 and it does improve ever so slightly and more so with the tickets page. The performance issue is still completely noticeable.
(In reply to Jesse Roland from comment #25) > Tried this with you up in comment 3 and it does improve ever so slightly and > more so with the tickets page. The performance issue is still completely > noticeable. Bah, sorry - it's easy to lose context moving between bugs. :/ I'll take another look at the profiles and see if anything else pops out.
Flags: needinfo?(mconley)
(In reply to Mike Conley (:mconley) - (Needinfo me!) from comment #26) > (In reply to Jesse Roland from comment #25) > > Tried this with you up in comment 3 and it does improve ever so slightly and > > more so with the tickets page. The performance issue is still completely > > noticeable. > > Bah, sorry - it's easy to lose context moving between bugs. :/ I'll take > another look at the profiles and see if anything else pops out. Wow, sorry for not getting back for about a month. Yikes. :( So nothing else really jumps out from these profiles when I ignore the uBlock stuff. The uBlock samples are completely dominating your profiles. You gathered profiles back in Comment 7 with your add-ons disabled, but it looks to me like you were using the built-in DevTools Performance Tab. What I need is for you to gather a profile by using the Gecko Profiler Add-on with the rest of your add-ons disabled. I'm so sorry to keep making you get data for us, but really this is the only way we're going to figure out what's going on here.
Flags: needinfo?(mconley)
Back on shift tonight and will collect some better profiles. I have switched to 64 bit Firefox and it does not like gecko profiler at all. I may have to switch back to 32 in the mean time.
Well I tried, getting this: http://imgur.com/zx8a2nv "Symbolication failed"
Finally got a profile through hopefully this helps. Had to install 32 bit and I have Ublock disabled. https://cleopatra.io/#report=4ded13f522c711ed91c913e5687be841fabfe5d3
Oh, that's much better, yes! Thank you! This looks to me like we're spending a lot of time painting. We're also cycle-collecting a lot towards the beginning of the profile. Hey jrmuizel - we've got the site saved to this bug, and a pretty clear profile here. Is this enough information to go on?
Flags: needinfo?(jmuizelaar)
It looks like a lot of the painting slowdown is because of widget backgrounds. We could probably do much better.
Depends on: 561265
Flags: needinfo?(jmuizelaar)
Can you try creating a new boolean pref for "mozilla.widget.disable-native-theme" and setting the pref to true to see if that improves performance?
Depends on: 1288513
(In reply to Jeff Muizelaar [:jrmuizel] from comment #33) > Can you try creating a new boolean pref for > "mozilla.widget.disable-native-theme" and setting the pref to true to see if > that improves performance? Didn't realize this was pointed at me, wish I would have tested this sooner. This indeed does improve performance on this site in my limited testing. I would generate another profile but gecko profiler addon crashes 64bit nightly right now. I have submitted a ticket on github. Thanks for helping out on this! Although this does make Firefox look a little weird!
(In reply to Jesse Roland from comment #34) > (In reply to Jeff Muizelaar [:jrmuizel] from comment #33) > > Can you try creating a new boolean pref for > > "mozilla.widget.disable-native-theme" and setting the pref to true to see if > > that improves performance? > > Didn't realize this was pointed at me, wish I would have tested this sooner. > This indeed does improve performance on this site in my limited testing. I > would generate another profile but gecko profiler addon crashes 64bit > nightly right now. I have submitted a ticket on github. Thanks for helping > out on this! > > Although this does make Firefox look a little weird! This fix was all but a mask, it continued to degrade in performance even after this initial performance boost.
Flags: needinfo?(jgroland)
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p1]
94% of this profile is in widget::WinUtils::WaitForMessage().
Component: Layout → Widget: Win32
(In reply to Jet Villegas (:jet) from comment #37) > 94% of this profile is in widget::WinUtils::WaitForMessage(). That's just waiting for messages. This profile is really heavy on display list construction and painting. Because painting seems to be heavier I'm moving it to graphics. There's a good amount of pixman region manipulation going on here (search for pixman_region). Also some expensive rasterization.
Component: Widget: Win32 → Graphics
Assignee: nobody → bas
Bas, because this is a split of graphics and layout, lets see if you can get to the graphics part soon, to give layout a chance at it after we're done. Unless retained display lists ends up being required.
Flags: needinfo?(bas)
Note that at least some part of this profile (the expensive use of SystemParametersInfo) was addressed in bug 1325743. Other than that the long rasterizes seem to be caused by the fact that we're drawing lots of text, and with a significant additional increase in cost because we're using Component Alpha layers. These are not costs that we can do anything in graphics to avoid, so I'm not so sure there -is- much of a a graphics part. If on the layout side we can avoid using Component Alpha layers here that will be the biggest improvement we can get here. There is a small bit of improvement we may get by avoiding calling SetTextAntialiasingMode, I'll have a look at that but it's not going to help much, component alpha layers are what is increasing our cost by over 2x. There's also a fair amount of context manipulation overhead because there is a lot of nsDisplayText display items doing small draws looking at the profile. Likely this is very hard to avoid and in any case the win would in no way be comparable to the win from not doing component alpha layers.
Flags: needinfo?(milan)
Flags: needinfo?(bugs)
Flags: needinfo?(bas)
Whiteboard: [qf:p1] → [qf:p3]
(In reply to Away for a while from comment #38) > This profile is really heavy on display list construction and painting. Now that we have Retained Display Lists enabled in Nightly, it would be good to give this another look.
Flags: needinfo?(bugs)
(In reply to Jet Villegas (:jet) from comment #41) > (In reply to Away for a while from comment #38) > > This profile is really heavy on display list construction and painting. > > Now that we have Retained Display Lists enabled in Nightly, it would be good > to give this another look. It appears to work better than I before. I do not have access to this live environment anymore though. The archive of the site above does work better but there is some delay when moving fast over the rows with the hover taking place.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Performance Impact: --- → P3
Whiteboard: [qf:p3]
Severity: normal → S3

Both test cases perform well now.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(milaninbugzilla)
Resolution: --- → WORKSFORME
Depends on: 1381938
No longer depends on: 1288513
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: