Bug 6167

Summary: RenderStyle default constructor should initialize its members for speed
Product: WebKit Reporter: Darin Adler <darin>
Component: CSSAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Enhancement CC: hyatt, mjs
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
both performance improvements described in the bug text
none
both performance improvements described in the bug text eric: review+

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.