Bug 6167 - RenderStyle default constructor should initialize its members for speed
Summary: RenderStyle default constructor should initialize its members for speed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 09:24 PST by Darin Adler
Modified: 2005-12-22 08:45 PST (History)
2 users (show)

See Also:


Attachments
both performance improvements described in the bug text (4.76 KB, patch)
2005-12-21 22:47 PST, Darin Adler
no flags Details | Formatted Diff | Diff
both performance improvements described in the bug text (4.89 KB, patch)
2005-12-21 22:51 PST, Darin Adler
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-12-20 09:24:32 PST
The default constructor for RenderStyle doesn't initialize its members. Instead it lets them all get default 
initialized and then uses assignment to set their initial values. This results in extra code because of the 
DataRef operator= implementation.

Also, DataRef's operator= should have the "==" check removed since that extra branch makes things a 
little slower.
Comment 1 Darin Adler 2005-12-21 22:47:47 PST
Created attachment 5215 [details]
both performance improvements described in the bug text
Comment 2 Darin Adler 2005-12-21 22:51:25 PST
Created attachment 5216 [details]
both performance improvements described in the bug text
Comment 3 Eric Seidel (no email) 2005-12-22 01:32:00 PST
Comment on attachment 5215 [details]
both performance improvements described in the bug text

Another great looking patch.  I assume this is a performance win?  r=me.
Comment 4 Eric Seidel (no email) 2005-12-22 01:38:39 PST
Comment on attachment 5215 [details]
both performance improvements described in the bug text

oops, wrong one.
Comment 5 Eric Seidel (no email) 2005-12-22 01:39:01 PST
Comment on attachment 5216 [details]
both performance improvements described in the bug text

r=me.

It looks like
 void RenderStyle::cleanup()
could just be killed entirely now.
Comment 6 Darin Adler 2005-12-22 08:32:22 PST
I left the cleanup function in there because Maciej has the commented-out counts in it. I would have 
removed it entirely if that wasn't there.