Closed
Bug 461766
Opened 17 years ago
Closed 15 years ago
Very slow appendChild on Linux
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: msucan, Unassigned)
References
()
Details
(Whiteboard: [CLOSEME 2010-11-01])
User-Agent: Opera/9.61 (X11; Linux i686; U; fr) Presto/2.1.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081027 Minefield/3.1b2pre
Node.appendChild(other_node) is very slow in Firefox 3+ on Linux, compared to Opera, Webkit and to Firefox 3+ for Windows.
Reproducible: Always
Steps to Reproduce:
1. Load the provided TC in Firefox 3+ on Linux.
2. Click the button.
3. Wait for "done!" to show.
Actual Results:
The code execution is very slow (several orders of magnitude slower). It takes an unusual amount of time to appendChild 2000 nodes.
Expected Results:
appendChild of 2000 nodes should be instant, in the same way as it is in Opera and WebKit.
The provided TC creates 2000 <span> elements and appends each of them to the #container. To avoid any rendering performance issues, I did set style="display:none" for #container.
The script runs instantly in Firefox 3+ on Windows. The performance issue is visible only on Linux with both Firefox versions (3.0.3 and 3.1 nightly build of today).
In Firefox 2 on Linux the script runs faster than in Firefox 3. It looks like this is a regression. Still, Firefox 2 doesn't do the appends instantly like Opera and Webkit.
Note: this performance issue does not seem related to the new JIT. I ran tests with JIT enabled and disabled (both run very slow). Besides, the perf issue is also valid in the case of Firefox 3.0 (which has no JIT).
I also tested doing 2000 appendChilds into a documentFragment, instead of #container. That's as fast as in the other browsers. It looks like this perf issue only affects appends to the main document.
| Reporter | ||
Comment 1•17 years ago
|
||
So, I've done more testing.
System information:
Ubuntu 8.04.1 (all updates)
Windows XP SP3 running in VirtualBox 1.6.6.
AMD Athlon XP 1800+ CPU.
Firefox 3.0.3 from Ubuntu repos with my default profile (just firebug installed, but suspended, and the devtoolbar).
Firefox 3.1 nightly (updated today), clean profile with no extensions.
Opera 9.61 build 2456 (my default profile).
WebKitGTK SVN trunk build (some time last week).
The TC run times for me as follow (5 clicks, each showing as miliseconds):
Opera: 63, 66, 64, 63, 65
WebKitGTK: 7, 9, 17, 10, 10
Firefox 3.0 on Linux: 191, 185, 196, 196, 181
Firefox 3.1 (jit enabled) on Linux: 178, 194, 193, 185, 187
Firefox 3.1 (jit enabled) on Windows: 60, 62, 54, 58, 66
(I notice no speed difference with jit disabled).
As one can see: Firefox 3+ on Linux is much slower.
Problem is that the TC run times do not really reflect the reality. Firefox 3+ on Linux took about 4 seconds to run for each click, actually. During the runs the entire UI was frozen.
Last, but not least: it is interesting to note that if I remove display:none from the #container, and I set some CSS rules for the spans, the spans are rendered and then Firefox continues to stay freezed for a few seconds. The render happens after about 0.1-0.2 seconds (as the TC times show).
I will attach a second TC which shows the post-render freeze.
| Reporter | ||
Comment 2•17 years ago
|
||
Here's the second TC which renders the spans:
http://www.robodesign.ro/coding/0053/index2.html
TC run times are the same in Opera and WebKit, but they don't include rendering (obviously)
In Firefox 3+ on Windows and Linux the run times are higher, in the range of 500-1000 ms. However, as noted previously, once the spans render, the Linux Firefox GUI freezes for a much longer time (about 10 seconds for the first click, and about a minute for the second, etc). This does not happen in Opera, nor in WebKit.
The hunch is that the garbage collector is the problem.
Comment 3•16 years ago
|
||
On my linux machine it takes 176ms to render this webpage (http://www.robodesign.ro/coding/0053/index2.html).
On Midori (WebKit browser) it takes 2ms to render it (though it seems to have the same performance, just shows better results).
On Opera 9.52 it takes 36 ms to render it. So, Firefox is approx 90 times slower than webkit with this.
Comment 4•15 years ago
|
||
This is a mass search for bugs which are in the Firefox General component, are
UNCO, have not been changed for 500 days and have an unspecified version.
Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
| Reporter | ||
Comment 5•15 years ago
|
||
Appending 100 000 elements on my system (Ubuntu 10.04, 64 bits) now takes:
- 1200 ms in Firefox 4 nightly builds.
- 1100 ms in Opera 10.62.
- 130 ms in Chromium 7 beta.
The initial report was about a far greater difference between all other browsers and Firefox. It seems now Firefox is not much slower when compared to Opera. Chrome is still the king, but that's a different story.
Marking this bug as RESOLVED > WORKSFORME.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Comment 6•15 years ago
|
||
http://www.robodesign.ro/coding/0053/index2.html
Ubuntu 10.10
Firefox 4.0 Beta 6
13 ms
You need to log in
before you can comment on or make changes to this bug.
Description
•