Closed Bug 303862 Opened 19 years ago Closed 17 years ago

performance problem with strict mode + nested padding + text-decoration

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: sync2d, Unassigned)

References

()

Details

(Keywords: perf, testcase, Whiteboard: [reflow-refactor])

Attachments

(3 files)

In strict mode, rendering of the decorated text contained in deeply
nested block element with padding specified by percentage is very slow.
Testcases will be attached.

Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b4) Gecko/20050806 Firefox/1.0+
strict mode one. rendered in 15 seconds @ K6-2 400MHz.
quirks mode one. rendered in <1 seconds @ K6-2 400MHz.
Assignee: dbaron → nobody
Component: Style System (CSS) → Layout: Block and Inline
QA Contact: ian → layout.block-and-inline
It's definetely slow in strict mode, so I would call that a bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Attached file script based testcase
Script based testcase that uses getComputedStyle().
This one demonstrates that CSS value calculation itself is always slow,
even if the document is in quirks mode or there is no text decorations.

http://lxr.mozilla.org/seamonkey/source/layout/style/nsComputedDOMStyle.cpp#3340

http://lxr.mozilla.org/seamonkey/source/layout/style/nsStyleStruct.cpp#422
Result of attachment 191955 [details] @ K2-2 400MHz:

machine speed: 4096 loops
level 0: slow=0/fast=0 msecs
level 1: slow=0/fast=0 msecs
level 2: slow=0/fast=0 msecs
level 3: slow=0/fast=0 msecs
level 4: slow=50/fast=0 msecs
level 5: slow=0/fast=0 msecs
level 6: slow=50/fast=0 msecs
level 7: slow=270/fast=0 msecs
level 8: slow=1100/fast=0 msecs
level 9: slow=4450/fast=0 msecs
level 10: slow=17850/fast=0 msecs
Summary: perfomance problem with strict mode + nested padding + text-decoration → performance problem with strict mode + nested padding + text-decoration
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20051027 Firefox/1.6a1
The bug still exists.

affected site: http://corbin.seesaa.net/category/267131.html
You can feel very slow scroll in the middle of the page.
The basic problem is that percentage paddings/borders have layout-dependent values and are not cached anywhere (so you have to recompute them any time you need them).  Recomputing requires computing the ancestor's padding _and_ border for each one, so computing the padding effectively becomes O(2^N) in the number of ancestors that have a percentage padding and border... (which is what the "script based testcase" shows).

The only reason this is not an issue for decorations in quirks mode is because they're not painted by the container they're set on, so don't need to deal with padding...
OS: Windows 98 → All
Hardware: PC → All
Whiteboard: [reflow-refactor]
Is this still an issue? wfm with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9pre) Gecko/2008041818 Minefield/3.0pre
Agreed. If someone wants to figure out when it was fixed (possibly by the reflow branch based on the whiteboard?), feel free to mark it FIXED.

-->WORKSFORME
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: