bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Unresponsiveness while displaying a large HTML document




6 years ago
6 years ago


(Reporter: florian, Unassigned)



Firefox Tracking Flags

(Not tracked)




6 years ago
Thunderbird 15+ supports Twitter, and I've noticed that displaying lots of tweets sometimes takes a lot of time.

The current code adds tweets to the HTML document in batches and stops after 50ms, but to understand what was actually taking CPU time, I commented out that part that stops after 50ms, and displayed a large batch of approximatively 10k tweets at once.

Out of the 50s that takes, 40s seem to be spent doing reflow.

I've saved the generated HTML DOM with DOMi, and fixed the paths so that the same HTML document could be loaded in Firefox, and I profiled it again there.

Loading the HTML document in Firefox from the local disk (file://) or from an http URL the second time (ie after it's been cached locally) makes the Firefox UI unresponsive.
What shows up in the profiler is time spent in nsCSSFrameConstructor and PresShell::ProcessReflowCommands.

I'm not sure if being unresponsive when loading a large (3.6MB) HTML document is expected or not, but in case it's not or in case there are low hanging fruits here, the document I used can be loaded from:

And here are some profiles:
Florian, how long are you seeing pageload take for http://queze.net/goinfre/largetimeline/ ?  I just tried it, and it takes at most 4 seconds for me (granted, on pretty new hardware).

Comment 2

6 years ago
Around 4s too on Firefox (and on a pretty new i7 Macbook Pro).

I haven't figured out yet why it makes such a large difference when it's loaded as a plain HTML file in the browser rather than as lots of chunks added in Tb with calls to appendChild with a documentFragment as paramater, but as it's still unresponsive in the browser and that part can trivially be reproduced, I figured I would still file a bug with the profiles I got from Firefox. Sorry if my previous comment was misleading :-(.

Unfortunately the profiles I uploaded from Thunderbird fail to load because of a JS error in the profiler web UI.
Just in case it gets fixed soon, here's the link to a Tb profile: http://people.mozilla.com/~bgirard/cleopatra/?report=83009d2d95d7e6974b00055ed8fd99fe68809a9d

Comment 3

6 years ago
(In reply to Florian Quèze [:florian] [:flo] from comment #2)

> Just in case it gets fixed soon, here's the link to a Tb profile:
> http://people.mozilla.com/~bgirard/cleopatra/
> ?report=83009d2d95d7e6974b00055ed8fd99fe68809a9d

So actually, this works in a current nightly of Firefox, but doesn't in 15.0 (see bug 790344 for details).
You need to log in before you can comment on or make changes to this bug.