Bug 69347

Summary: Shrink HTMLTableCellElement.
Product: WebKit Reporter: Andreas Kling <kling>
Component: TablesAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, koivisto, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch
koivisto: review+, kling: commit-queue-
Patch for landing (r=anttik) none

Description Andreas Kling 2011-10-04 10:31:17 PDT
We don't need to cache the rowspan and colspan attributes on the element.
Comment 1 Andreas Kling 2011-10-04 10:32:06 PDT
Created attachment 109640 [details]
Proposed patch
Comment 2 Antti Koivisto 2011-10-04 10:37:05 PDT
r=me
Comment 3 Darin Adler 2011-10-04 10:45:41 PDT
Comment on attachment 109640 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109640&action=review

> Source/WebCore/ChangeLog:10
> +        Don't cache the rowspan and colspan attributes on the element.
> +        This shrinks HTMLTabelCellElement by one CPU word, reducing memory
> +        consumption by 80 kB (on 64-bit) when loading the full HTML5 spec.

What’s the performance impact? How often are these functions called?

> Source/WebCore/html/HTMLTableCellElement.cpp:59
> +    if (colSpanValue.isNull())
> +        return 1;

Null check seems unneeded, the next line gives 1 without a special case.

> Source/WebCore/html/HTMLTableCellElement.cpp:67
> +    if (rowSpanValue.isNull())
> +        return 1;

Null check seems unneeded, the next line gives 1 without a special case.
Comment 4 Andreas Kling 2011-10-04 10:48:18 PDT
(In reply to comment #3)
> (From update of attachment 109640 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109640&action=review
> 
> > Source/WebCore/ChangeLog:10
> > +        Don't cache the rowspan and colspan attributes on the element.
> > +        This shrinks HTMLTabelCellElement by one CPU word, reducing memory
> > +        consumption by 80 kB (on 64-bit) when loading the full HTML5 spec.
> 
> What’s the performance impact? How often are these functions called?

Sorry, I responded to Antti on IRC about this. They are only called once from RenderTableCell::updateFromElement(). They are then cached on the renderer as well.

> > Source/WebCore/html/HTMLTableCellElement.cpp:59
> > +    if (colSpanValue.isNull())
> > +        return 1;
> 
> Null check seems unneeded, the next line gives 1 without a special case.

You are right, thanks! I'll land without that.

> > Source/WebCore/html/HTMLTableCellElement.cpp:67
> > +    if (rowSpanValue.isNull())
> > +        return 1;
> 
> Null check seems unneeded, the next line gives 1 without a special case.

Ditto.
Comment 5 Andreas Kling 2011-10-04 10:50:33 PDT
Created attachment 109646 [details]
Patch for landing (r=anttik)
Comment 6 WebKit Review Bot 2011-10-04 13:38:50 PDT
Comment on attachment 109646 [details]
Patch for landing (r=anttik)

Clearing flags on attachment: 109646

Committed r96638: <http://trac.webkit.org/changeset/96638>
Comment 7 WebKit Review Bot 2011-10-04 13:38:55 PDT
All reviewed patches have been landed.  Closing bug.