Open
Bug 951052
Opened 11 years ago
Updated 5 months ago
Improve performance on hixie's element insertion microbenchmark on Android
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
NEW
Performance Impact | none |
People
(Reporter: salar2k, Unassigned)
References
()
Details
DOM operations are very slow in android platform.
Here are some test results according to Hixie's performance test:
http://nontroppo.org/timer/Hixie_DOM.html
Tested on HTC Desire C with Cpu Snapdragon 600MH
Android version 4.0.3
Firefox for Android 26.0: 5711ms
Google Chrome 31: 827ms
Opera for Android 16.0: 948ms
Updated•11 years ago
|
Component: General → DOM
Product: Firefox for Android → Core
Version: unspecified → Trunk
Seems likely to be a timer resolution problem or a JIT problem to me.
![]() |
||
Comment 2•11 years ago
|
||
Actually, this particular microbenchmark is probably just slow because of the way that we represent child lists as an array. This benchmark exercises the worst-case behavior of this representation: it inserts tens of thousands of elements, one at a time, at the beginning of the list. The result is that we spend all of our time in memmove, and if the platform has slow memory (which I bet the HTC desire does), that will really hurt.
I would be interested in the actual subtest results, not just the overall time, that you see on the HTC desire to verify that hypothesis.
If this is indeed what's going on, then this is not a terribly high priority, because this is not a common access pattern in real websites (for example real websites pretty much never have child lists this long). And the right fix in this case is bug 651120.
Note also that the canonical home for this benchmark is http://www.hixie.ch/tests/adhoc/perf/dom/artificial/core/001.html
Depends on: 651120
Summary: Improve DOM performance in Android platform → Improve performance on hixie's element insertion microbenchmark
![]() |
||
Updated•11 years ago
|
Flags: needinfo?(salar2k)
The results was with newly opened firefox; they're worse with recently closed tabs.
Total elapsed time: 7069ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 1171ms
Prepend: 2.44; 2855ms
Index: 0.03; 37ms
Insert: 1.77; 2069ms
Remove: 0.80; 937ms
Flags: needinfo?(salar2k)
![]() |
||
Comment 4•11 years ago
|
||
OK, but what are the corresponding numbers for Chrome on the same hardware?
Sorry, my bad.
Chrome 31:
Total elapsed time: 938ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 284ms
Prepend: 0.89; 253ms
Index: 0.15; 43ms
Insert: 0.88; 250ms
Remove: 0.38; 108ms
Opera 16:
Total elapsed time: 924ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 228ms
Prepend: 1.12; 256ms
Index: 0.20; 46ms
Insert: 1.18; 268ms
Remove: 0.55; 126ms
Puffin Browser 3.0.10154M
Total elapsed time: 2654ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 11ms
Prepend: 1.00; 11ms
Index: 0.73; 8ms
Insert: 1.73; 19ms
Remove: 236.82; 2605ms
![]() |
||
Comment 6•11 years ago
|
||
OK. So it's worth looking at the difference in the "Append" case, for sure. And "Puffin Browser" seems to have a broken date implementation or something...
Mark, is it possible to get a profile of this thing on Android?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mark.finkle)
Summary: Improve performance on hixie's element insertion microbenchmark → Improve performance on hixie's element insertion microbenchmark on Android
Comment 7•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] (Vacation Dec 19 to Jan 1) from comment #6)
> OK. So it's worth looking at the difference in the "Append" case, for sure.
> And "Puffin Browser" seems to have a broken date implementation or
> something...
>
> Mark, is it possible to get a profile of this thing on Android?
I managed to get a profile:
http://people.mozilla.org/~bgirard/cleopatra/#report=97cbad39df2fc52fac2c4464183a5fe61bd3e866
The test() call starts at:
Startup::XRE_Main > Timer::Fire > js::RunScript
Flags: needinfo?(mark.finkle)
Comment 8•11 years ago
|
||
That profile is from a Nexus 4 running Android 4.4.2
![]() |
||
Comment 9•11 years ago
|
||
Hrm. That profile shows 7% of the time is spent under testAppend(), but the actual leaves under there don't seem to show any obvious hotspots and the self time is 0.
Contrast with testInsert, which clearly shows a hotspot in bcopy... though only for half the total time(!).
Why do we have calls out to java_org_mozilla_gecko_gfx_NativePanZoomController_getRedrwaHint under testAppend?
Comment 10•11 years ago
|
||
(In reply to Vacation Dec 19 to Jan 1 from comment #9)
> Hrm. That profile shows 7% of the time is spent under testAppend(), but the
> actual leaves under there don't seem to show any obvious hotspots and the
> self time is 0.
>
> Contrast with testInsert, which clearly shows a hotspot in bcopy... though
> only for half the total time(!).
>
> Why do we have calls out to
> java_org_mozilla_gecko_gfx_NativePanZoomController_getRedrwaHint under
> testAppend?
I really don't know, but looking at the code, we _might_ bet getting into NativePanZoomController_getRedrawHint from a geometryChanged call. Maybe the changes in the DOM are being seen as a screen size change?
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/GeckoLayerClient.java#730
calls
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/GeckoLayerClient.java#177
Do we have a bug filed on this performance issue for Desktop Firefox? I see significant differences between desktop Firefox (~230ms total) and Chrome (~40ms total).
Comment 11•11 years ago
|
||
Kats - Any idea on the NativePanZoomController_getRedrawHint question?
Flags: needinfo?(bugmail.mozilla)
Comment 12•11 years ago
|
||
Uh, I can see no reason whatsoever that function should be getting called. At all. That code is disabled on Fennec. I can only assume this is a symbolication error of some sort. BenWa?
Flags: needinfo?(bugmail.mozilla) → needinfo?(bgirard)
Comment 13•11 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #10)
> I really don't know, but looking at the code, we _might_ bet getting into
> NativePanZoomController_getRedrawHint from a geometryChanged call. Maybe the
> changes in the DOM are being seen as a screen size change?
>
> http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/
> GeckoLayerClient.java#730
> calls
> http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/
> GeckoLayerClient.java#177
>
(Note that on Fennec we are still using the JavaPanZoomController, not the NativePanZoomController, so the call at line 177 above should hit http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/gfx/JavaPanZoomController.java#1308)
Comment 14•11 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #12)
> Uh, I can see no reason whatsoever that function should be getting called.
> At all. That code is disabled on Fennec. I can only assume this is a
> symbolication error of some sort. BenWa?
Yes it is, it a bad interaction with elfhack and the profiler. We had profiler working on elfhack binaries at some point but it looks like we regressed. We could profile again with a non elfhack binary to get better symbol.
The current poorly symbolicate profile doesn't show a hotspot but a properly symbolicate profile *might*.
Flags: needinfo?(bgirard)
![]() |
||
Comment 15•11 years ago
|
||
> Do we have a bug filed on this performance issue for Desktop Firefox?
Yes, bug 651120. The thing this bug depends on.
Again, I'm only really interested in the append part of this test; poor performance on the remove/insert/prepend bits is expected.
Reporter | ||
Comment 16•11 years ago
|
||
> Do we have a bug filed on this performance issue for Desktop Firefox?
https://bugzilla.mozilla.org/show_bug.cgi?id=606503
https://bugzilla.mozilla.org/show_bug.cgi?id=606474
![]() |
||
Comment 17•11 years ago
|
||
Bug 606503 is a bug in an add-on, not in Desktop Firefox.
Reporter | ||
Comment 18•11 years ago
|
||
Any news on this?
Using Firefox 29 have same results.
Reporter | ||
Comment 19•11 years ago
|
||
*has
:D
Reporter | ||
Comment 20•10 years ago
|
||
It is Firefox 33 and still no one is interested in having a deep look?
The results are the same.
Reporter | ||
Comment 21•10 years ago
|
||
Firefox 35 on BlueStacks emulator:
Total elapsed time: 3240ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 490ms
Prepend: 2.39; 1170ms
Index: 0.06; 30ms
Insert: 2.04; 1000ms
Remove: 1.12; 550ms
Android 4.4.2 browser on BlueStacks emulator:
Total elapsed time: 90ms
Breakdown (fraction shows time relative to append time):
Append: 1.00; 50ms
Prepend: 0.20; 10ms
Index: 0.00; 0ms
Insert: 0.60; 30ms
Remove: 0.00; 0ms
I thing one of the reasons Firefox feels a little slower on Android is the DOM operations. Please someone pay more attention to this.
Comment 22•7 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
Comment 23•7 years ago
|
||
On Android we're still a bit slower. On Linux Nightly seems to be faster than Chrome.
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•3 years ago
|
Updated•2 years ago
|
Severity: major → S3
Performance Impact: --- → ?
Priority: P5 → --
Comment 24•2 years ago
|
||
The Performance Impact Calculator has determined this bug's performance impact to be none. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.
Platforms: Android
Websites affected: Rare
Performance Impact: ? → none
You need to log in
before you can comment on or make changes to this bug.
Description
•