[Webkit-unassigned] [Bug 39647] New: Big rendering performance issue with multiple font-faces which cause recalculating styles

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 24 23:19:01 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=39647

           Summary: Big rendering performance issue with multiple
                    font-faces which cause recalculating styles
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mikelikespie at gmail.com


Created an attachment (id=56974)
 --> (https://bugs.webkit.org/attachment.cgi?id=56974)
Testcase with slow behaviour simulated with javascript

At Scribd we've been @font-face excessively.  Unfortunately, getting multiple fonts to load quickly has proven to be quite the challenge.

I've narrowed it down to  to the fact that after each font-face loads, the style gets recalculated.  This even happens if you have several uri-encoded fonts in one CSS file.

The only way I've been able to get around this (sometimes) is displaying an element with a given font-face, setting its display to none  after a little bit, and then loading the CSS in.  This makes it (sometimes) load the font when the CSS is loaded without it having to recalculate the style.

This performance issue is most apparent when looking at the Timeline  view in developer tools and is most noticeable using chrome (it recalculates the layout a bit slower than Safari it seems).

The time to recalculate the style is much more significant on Scribds' website because there's toolbars, ads, and whatnot which give it more load I imagine.

I attached two files.  slowfont.html which is a repro of the performance issue.  fastfont.html is an example of the workaround (which works in chrome at least).  You'll notice in fastfont there are not N "Recalculate Style" events and it performs faster (even though it has 1.5 seconds worth of timeouts).

I haven't been able to figure out a reliable way to "prime" webkit to *quickly* load a font without it causing the layout to recalculate.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list