Bug 144277

Summary: Reduce allocations and memory usage when compiling content extensions.
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: WebCore Misc.Assignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch benjamin: review+

Description Alex Christensen 2015-04-27 14:20:34 PDT
The BitVector in Term always has capacity of 128, so it always allocates 16 bytes in addition to a pointer to the allocated buffer and additional malloc overhead.  Let's just have the 16 bytes.
Comment 1 Alex Christensen 2015-04-27 14:22:24 PDT
Created attachment 251776 [details]
Patch
Comment 2 Benjamin Poulain 2015-04-27 14:46:08 PDT
Comment on attachment 251776 [details]
Patch

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

Can you remove the #include <BitVector>?

> Source/WebCore/contentextensions/Term.h:131
> +        void set(unsigned character)

unsigned -> UChar?

> Source/WebCore/contentextensions/Term.h:137
> +        bool get(unsigned character) const

ditto.
Comment 3 Alex Christensen 2015-04-27 15:36:38 PDT
http://trac.webkit.org/changeset/183433