[webkit-reviews] review denied: [Bug 107371] Pre-allocate our CompatHTMLToken Vector since we know how big it will be the the common case : [Attachment 183617] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 19 11:10:57 PST 2013


Adam Barth <abarth at webkit.org> has denied Eric Seidel <eric at webkit.org>'s
request for review:
Bug 107371: Pre-allocate our CompatHTMLToken Vector since we know how big it
will be the the common case
https://bugs.webkit.org/show_bug.cgi?id=107371

Attachment 183617: Patch
https://bugs.webkit.org/attachment.cgi?id=183617&action=review

------- Additional Comments from Adam Barth <abarth at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=183617&action=review


> Source/WebCore/ChangeLog:10
> +	   We know the maximum size of this buffer, so pre-allocate it to that
size
> +	   for a small savings.  This shows us spending slightly less time in
malloc,
> +	   but doesn't seem noticable on the final runtime (at least not
outside the error bars).

I looked at this patch and didn't see much if any change in the benchmark.  On
other workloads (say those with many scripts), it's not clear to me whether
reserving this much space is actually a good thing.  If we're only sending off
a hundred tokens in a chunk, then reserving space for 4k seems wasteful in
terms of memory.

Before making this change, I'd like to either see some data showing its a win
or be convinced that it's never a loss.


More information about the webkit-reviews mailing list