Bug 22093

Summary: Don't keep decoded stylesheet data in cache
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
patch
mitz: review+
fix the regression mitz: review+

Description Antti Koivisto 2008-11-05 18:11:28 PST
Don't keep decoded stylesheet string around in the cache. There are no sharing benefits and performance benefits are negligible.
Comment 1 Antti Koivisto 2008-11-05 18:14:57 PST
Created attachment 24930 [details]
patch

Decode stylesheet data on demand
Comment 2 mitz 2008-11-05 18:38:39 PST
Comment on attachment 24930 [details]
patch

> +        https://bugs.webkit.org/post_bug.cgi

Bad link.

r=me
Comment 3 Antti Koivisto 2008-11-05 18:41:10 PST
Sending        WebCore/ChangeLog
Sending        WebCore/loader/CachedCSSStyleSheet.cpp
Sending        WebCore/loader/CachedCSSStyleSheet.h
Transmitting file data ...
Committed revision 38147.
Comment 4 Antti Koivisto 2008-11-06 22:49:06 PST
This caused regression in fast/encoding/css-charset-default.xhtml
Comment 5 Antti Koivisto 2008-11-06 22:56:31 PST
Created attachment 24966 [details]
fix the regression
Comment 6 mitz 2008-11-06 23:11:33 PST
Comment on attachment 24966 [details]
fix the regression

You could use a file static for the decoded text and save the cost of a String in every CachedCSSStyleSheet, but would not be very elegant.

+     if (!m_decodedSheetText.isNull())

I thought you could write just if (m_decodedSheetText) but perhaps you can't.

r=me
Comment 7 Antti Koivisto 2008-11-06 23:17:58 PST
(In reply to comment #6)
> (From update of attachment 24966 [details] [edit])
> You could use a file static for the decoded text and save the cost of a String
> in every CachedCSSStyleSheet, but would not be very elegant.

Not very elegant plus there is bound to be some crazy way this recurses...

> +     if (!m_decodedSheetText.isNull())
> 
> I thought you could write just if (m_decodedSheetText) but perhaps you can't.

True. All these fancy operators. Fixed.

> 
> r=me
> 

Comment 8 Antti Koivisto 2008-11-06 23:23:09 PST
Sending        WebCore/ChangeLog
Sending        WebCore/loader/CachedCSSStyleSheet.cpp
Sending        WebCore/loader/CachedCSSStyleSheet.h
Transmitting file data ...
Committed revision 38213.