Closed
Bug 1139709
Opened 10 years ago
Closed 10 years ago
nsMathMLContainerFrame should cache its intrinsic width
Categories
(Core :: MathML, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: roc, Assigned: roc)
Details
Attachments
(3 files)
326.45 KB,
application/java-archive
|
Details | |
5.54 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
4.40 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
Someone sent me a test page full of MathML which renders incredibly slowly in Firefox. I'm attaching a version of it which takes 68s to render for me on trunk.
We spend the majority of the time in nsMathMLContainerFrame::GetMinISize/GetPrefISize --- which actually compute the same thing. We should cache the intrinsic width, which will cut that time in half by sharing the results between GetMinISize/GetPrefISize, and probably by more since we can also reuse intrinsic widths across reflows.
There is a risk that dynamic changes to MathML could break if intrinsic widths are not currently invalidated correctly. However, nsMathMLContainerFrame is currently very conservative and invalidates intrinsic widths on any AttributeChanged. Also, wherever MathML fails to invalidate intrinsic widths is already a bug since inline MathML contributes to the cached intrinsic widths of non-MathML containers.
Assignee | ||
Comment 1•10 years ago
|
||
For me, this reduces the load time of the testcase in bug 1139709 from
68s to 34s.
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8572968 -
Flags: review?(mats)
Assignee | ||
Updated•10 years ago
|
Attachment #8572970 -
Flags: review?(mats)
Assignee | ||
Comment 3•10 years ago
|
||
Now this page spends > 50% of its load time in nsMathMLChar::GetMaxWidth. A global stretchy-char-max-width cache would probably make this a lot faster. However, it's slightly tricky to implement and probably isn't worth implementing right now.
Comment 4•10 years ago
|
||
Comment on attachment 8572968 [details] [diff] [review]
Cache nsMathMLContainerFrame's intrinsic width
r=mats
>layout/mathml/nsMathMLContainerFrame.cpp
> ...::UpdateIntrinsicWidth(nsRenderingContext *aRenderingContext)
Perhaps you could change GetMinISize, GetPrefISize to use the more
common code style "nsRenderingContext* " instead?
Would be nice, since it's the last instances in this file, AFAICT.
Attachment #8572968 -
Flags: review?(mats) → review+
Comment 5•10 years ago
|
||
Comment on attachment 8572970 [details] [diff] [review]
Remove unused parameters from nsMathMLChar::GetMaxWidth
r=mats, same nsRenderingContext* comment here.
Attachment #8572970 -
Flags: review?(mats) → review+
Comment 6•10 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #3)
> Now this page spends > 50% of its load time in nsMathMLChar::GetMaxWidth. A
> global stretchy-char-max-width cache would probably make this a lot faster.
> However, it's slightly tricky to implement and probably isn't worth
> implementing right now.
In general, nsMathMLChar is not very efficient at the moment. See also bug 1009582.
Assignee | ||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d151e628b2e8
https://hg.mozilla.org/mozilla-central/rev/22cf89e35a51
https://hg.mozilla.org/mozilla-central/rev/3c86caa855ee
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•