New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 613816 link

Starred by 37 users

Issue metadata

Status: Duplicate
Merged: issue 613658
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Performance degradation of appendChild

Reported by oism...@gmail.com, May 21 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Open up Gmail and login
2. Reply to a bunch (10-20) of threads but don't actually send the replies, just keep them as drafts.
3. Refresh Gmail
4. Open a compose window, click on the emoji picker, note that it comes up instantly.
5. Goto drafts list
6. Click on each draft reply and then press back to go back to drafts list
7. Once you've done that for all your draft replies, open a new compose window
8. Click on the emoji picker and notice the lag for it to render the emoji picker.

If you do a timeline profile of bringing up the emoji picker at step 4 when it comes up instantly and compare it to the time it takes at step 8 you'll see that substantially more time starts to get spent in "appendChild".

What is the expected behavior?
The time to bring up the emoji picker should not increase. appendChild should not consume more time.

What went wrong?
appendChild consumes more and more time causing lag in all operations in Gmail, most notable with bringing up the emoji picker.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? Yes Chrome 49 and below

Does this work in other browsers? Yes 

Chrome version: 50.0.2661.102  Channel: stable
OS Version: OS X 10.11.3
Flash Version: Shockwave Flash 21.0 r0

Tested this in Safari and it doesn't happen.

In our testing this happens to 90% of accounts. So if it doesn't happen to you try using a different account.

We've already eliminated Gmail doing something stupid like calling appendChild more and more times. appendChild is being called the same number of times.

Also the timeline does not show an increase in layout/styling/painting time. So either that is incorrect and the dev tools are missing information, or something else is going on.
 
Cc: tkonch...@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on mac 10.11 chrome version 50.0.2661.102 and canary - did not observe too much lag on clicking the emoji picker. However a little lag(few seconds) is seen

Could you please replicate the same on a new profile where there are no apps/extensions and update the thread. You can create a new profile from chrome://settings

Comment 2 by oism...@gmail.com, May 24 2016

I was able to recreate the issue with a fresh profile with no apps/extensions. I also recorded the timeline.

Look at the two attached files. There's "fast timeline" and "slow timeline". Fast timeline is taken right after refreshing Gmail. And "slow timeline" is taken after performing the open draft reply actions about 15 times.

Notice the overall time difference in the onClick event callback goes from 250ms to almost 1s. Also notice that in the "fast timeline" "appendChild" function only takes 3.3ms and 1% of the event time. In the "slow timeline" appendChild takes 290ms and 25% of the event time.

I've also privately emailed you a video recording (it's our Gmail so has personal information in it).


And I did mention that it happened to 9 out of the 10 accounts that we tested with. If you have multiple Gmail accounts try different ones.
fast timeline.png
370 KB View Download
slow timeline.png
339 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, May 25 2016

Labels: -Needs-Feedback Needs-Review
Owner: tkonch...@chromium.org
Thank you for providing more feedback. Adding requester "tkonchada@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by rsesek@chromium.org, May 25 2016

Components: Blink>DOM
Hi all!
I was also able to reproduce the issue, after refresh the delay is gone.
But I reproduced this problem not only in Gmail. Application I'm working on also has similar problem. The thing is that we have a column with list of conversations and when user clicks on one conversation it loads to the main area. Users have complained of performance a lot lately. After some time of working the rendering of the main area starts to take about 5-10 seconds (normally it should be 2s maximum). I profiled the application and noticed that DOM operations (like appendChild, replaceChild, cloneNode, insertBefore) performed very slow. For example, in normal state I can see at the timeline about 10 appendChild operations (I guess other appendChild calls aren't shown in the timeline cause the take less then 0.01ms), and when the performance is bad its number is about 400 and some calls can take several milliseconds.
So my problem looks very similar to this issue. It seems like users started to complain about this problem after they updated to 50v.
I am observing the exact same problem on the application that I work on, and it also started when Chrome 50 was released.
This is also occurring with Windows 7 starting with Chrome V50 and is still present with v51.
Cc: tkent@chromium.org
+tkent, could you investigate this? There's a few independent reports of M50 so this is probably something.

Comment 9 Deleted

Comment 10 by tkent@chromium.org, May 30 2016

The reproduce step is too complex to investigate this.  Can someone make a smaller reproduction?

 Issue 614856  might be related to this.

Comment 11 by oism...@gmail.com, May 30 2016

Hi tkent, I just sent you an email with the video to show how the reproduction steps aren't that bad. You don't need to generate new draft replies each time. If you already have a bunch of threads with draft replies you just need to visit those threads and that will trigger the slow DOM operations.
Project Member

Comment 12 by sheriffbot@chromium.org, May 31 2016

Labels: -Needs-Feedback Needs-Review
Thank you for providing more feedback. Adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Review Needs-Feedback
Hmm I couldn't reproduce the issue even in the way of oismail@'s video.

Would anyone collect tracing file by following steps, and attach it to this issue please?  The file won't contain any privacy data.

1. Open "chrome://tracing/" in new tab.
2. Close all tabs other than the chrome:://tracing/ and the site you reproduce the performance issue.
3. In chrome:://tracing/, press [Record]
4. Click "Edit categories" in a dialog
5. Check "blink_gc" "blijnk.invalidataion" and "blink.style" in the right column (do not uncheck others)
6. Activate the tab of the site with performance issue.
7. If you need some operations before observing the slowness, do them. (Something like step 1-7 in the original report)
8. Switch chrome:://tracing/ tab
9. Press [Record] in the dialog
10. Switch to the tab of the site
11. Do the slow operation. (Like step 8 in the original report) Wait until the operation is done.
12. Switch to chrome://tracing/ tab
13. Press [Stop] button in the dialog
14. Press [Save] button at the top
15. Type "slow-dom" in the text field in the dialog, and press [OK] button
16. You'll have trace_slow-dom.json.gz.  Please attach it here.


Comment 14 by oism...@gmail.com, Jun 2 2016

Please find the trace attached.

Also I was going to do a git bisect on the Chromium project to figure out the first commit that introduced the problem. But building Chromium is a huge pain and build times are ridiculous. Please let me know if the trace gives sufficient information or if I should do the git bisect.
trace_slow-dom.json.gz
914 KB Download

Comment 15 by oism...@gmail.com, Jun 2 2016

Sorry, I didn't have the correct blink.style selected. Here's the new trace with the correct settings.


trace_slow-dom (1).json.gz
869 KB Download

Comment 16 by oism...@gmail.com, Jun 2 2016

Here are 2 more traces with different settings, I think the main one that shows more information is the v8.cpu_profile.hires

I took one trace when Gmail was in a good state (fast-dom-v8-hirez) right after refreshing. And I took another trace after putting Gmail into a slow state (slow-dom-v8-hirez).

It's easy for me to generate these trace files, so let me know if there are other recording settings you'd like me to try it with. Hope this is helpful.

trace_slow-dom-v8-hirez.json.gz
1.9 MB Download
trace_fast-dom-v8-hirez.json.gz
1.4 MB Download
Components: Blink>JavaScript
Thank you for the data!
What I understand for now is V8.External consumes 1.484sec in the slow case, and 0.17sec in the fast case.

#14
> Also I was going to do a git bisect on the Chromium project to figure out the first commit that introduced the problem. 

Thank you for trying it.
If you have a Chromium checkout, you have a useful tool.

% ./tools/bisect-build.py -g 369907 -a YOUR_PLATFORM

369907 is a branch point of Google Chrome 49.  Probably you want to specify -p to keep Gmail credential.  This command downloads various revisions of Chromium, and ask you to reproduce the problem interactively.


Comment 18 by oism...@gmail.com, Jun 2 2016

That bisect-build tool is amazing! Here's the result:

You are probably looking for a change made after 371206 (known good), but no later than 371212 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/80858159012549fb0d3579d1c77e2ab243ec6ec3..d6193f3c2f6d043b3588290fdbfdefbc88f7a208


If there's nothing in those commits that looks suspicious then it's possible I screwed up the bisect and said one was good when it wasn't. For sure 371212 is bad. The other one I said was good that's near the lower bound is 371203. I also said 371181 was good. It's highly unlikely I marked all 3 of those revisions as good mistakenly.

Let me know if there's anything else I can do.
Cc: -tkent@chromium.org oilpan-reviews@chromium.org
Components: -Blink>JavaScript -Blink>DOM Blink>MemoryAllocator>GarbageCollection
Labels: -Pri-2 -Type-Compat -Needs-Feedback ReleaseBlock-Stable M-52 Pri-1 Type-Bug-Regression
Owner: haraken@chromium.org
Status: Assigned (was: Unconfirmed)
#18, Thank you very much!
Then Oilpan is most suspicious.

Comment 20 Deleted

Comment 21 by oism...@gmail.com, Jun 2 2016

Agreed that Oilpan is the most suspicious. Please let me know in what other ways I can help out i.e. running a specific version of Chromium with extra diagnostics running while I trigger the bad behavior.

(I deleted comment 20 because I posted about Oilpan before I refreshed the page and saw your comment)
Mergedinto: 613658
Status: Duplicate (was: Assigned)
I cannot access the info for  issue 613658  (https://bugs.chromium.org/p/chromium/issues/detail?id=613658).  It tells me I don't have permission to view the requested page.
How can I track down the status for this issue since I don't have access to the issue it has been duplicated against?
Cc: haraken@chromium.org brajkumar@chromium.org
 Issue 614856  has been merged into this issue.

Comment 26 Deleted

Sign in to add a comment