Bug 144277 - Reduce allocations and memory usage when compiling content extensions.
Summary: Reduce allocations and memory usage when compiling content extensions.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-27 14:20 PDT by Alex Christensen
Modified: 2015-04-27 15:36 PDT (History)
0 users

See Also:


Attachments
Patch (7.20 KB, patch)
2015-04-27 14:22 PDT, Alex Christensen
benjamin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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