Firefox hangs for long time when opening box.com document (thousands of <use> elements)
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: yury, Unassigned)
References
(Depends on 1 open bug)
Details
(Keywords: perf)
Attachments
(2 files)
Reporter | ||
Comment 1•11 years ago
|
||
Reporter | ||
Updated•11 years ago
|
Comment 2•11 years ago
|
||
Updated•11 years ago
|
Updated•11 years ago
|
Comment 4•11 years ago
|
||
Updated•11 years ago
|
Comment 5•11 years ago
|
||
Reporter | ||
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
Updated•11 years ago
|
Comment 8•11 years ago
|
||
Comment 9•11 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
Comment 11•5 years ago
|
||
Yury, the file https://app.box.com/s/euscsfh0h9pgbeqq57g4 cannot be accessed anymore, can you please confirm if this bug eventually got resolved or is still valid? I'm trying to identify performance bugs that would impact Enterprise users.
Reporter | ||
Comment 12•5 years ago
|
||
(In reply to Romain Testard [:RT] from comment #11)
Yury, the file https://app.box.com/s/euscsfh0h9pgbeqq57g4 cannot be accessed anymore, can you please confirm if this bug eventually got resolved or is still valid? I'm trying to identify performance bugs that would impact Enterprise users.
The link came from somewhere else. I reduced the referenced document into the test case I attached. Fixing the test case performance will fix the original document.
Comment 13•5 years ago
|
||
Chrome takes quite a while to finish rendering the attached testcase, too, though it finishes loading in less than a minute, whereas my Firefox tab has the throbber bouncing forever, it seems.
The testcase itself is a giant <img src="data:image/svg+xml,...">
element, with ~4.5mb of SVG data (which is largely composed of 37463 <use> elements that are referencing #Image_7_2_TK7m2L
, which is this 5x5 <image>
:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAMAAAC6sdbXAAADAFBMVEX////8/Pz6+vr09PTy8vLv7+/r6+sKCgoHBwcDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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
It looks like there's some initial load work, and then a long time spent in mozilla::image::ProgressTracker::OnUnlockedDraw
(which spends quite a while in ImageIsAnimated
for some reason -- as far as I can tell, the image here is not animated, but apparently there's enough overhead in determining that for this to show up in the backtrace).
Comment 14•5 years ago
|
||
The testcase itself is a giant <img src="data:image/svg+xml,..."> element
Here's the SVG document as a standalone file. (I've replaced ><
with >[newline]<
throughout the file, for readability's sake. Beyond that, it's the direct data URI from the original reduced testcase here.)
Comment 15•5 years ago
|
||
Note that we render the standalone SVG document pretty quickly (in < 10 seconds on my machine) -- significantly faster than Chrome does, in fact.
For the <img> version, I'm guessing that it hits some SVG-as-an-image notification death-spiral, with e.g. each <image>
-load triggering a full repaint of the <img>
or something like that. (I don't know that it's exactly that, but something like that probably).
Comment 16•5 years ago
|
||
Note also that the attached testcase seems to have been generated by "crocodoc" (as can be seen via various crocodoc-themed class-names in the SVG file).
This is a tool that was acquired in 2013 by Box:
https://techcrunch.com/2013/05/09/box-acquires-crocodoc-to-add-html5-document-converter-and-sleek-content-experience-to-cloud-storage-platform/
However, it seems that Box EOL'ed this tool in Jan 2018 (replacing it with "new box view", whatever that is). References:
(1) "Blackboard’s current inline grading tool Crocodoc will reach its end-of-life date on January 15, 2018."
https://umaine.edu/citl/transitioning-crocodoc-new-box-view-blackboard/
(2) @crocodoc twitter account tweeted a crying crocodile with caption "After a while, crocodile" on Jan 16 2018
https://twitter.com/Crocodoc/status/953378523086860288
So it appears this particular document-generation-tool is no longer in use on Box, for what it's worth. Hopefully that means Box users aren't actually running up against this at this point.
Comment 17•3 years ago
|
||
FWIW, the reduced testcase.html got massively improved by bug 1753453. The testcase loads in 6-8 seconds for me now.
Bug 1753453 - Don't send OnUnlockedDraw for non-animated images. r=aosmond
We're checking animation consumers, not locked status. We don't care
about animation consumer count of non-animated images.
Depends on D137765
Differential Revision: https://phabricator.services.mozilla.com/D137766
Updated•2 years ago
|
Description
•