[webkit-reviews] review denied: [Bug 121899] Optimize strings copies in srcset parser : [Attachment 212551] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 25 10:13:12 PDT 2013


Alexey Proskuryakov <ap at webkit.org> has denied Romain Perier
<romain.perier at gmail.com>'s request for review:
Bug 121899: Optimize strings copies in srcset parser
https://bugs.webkit.org/show_bug.cgi?id=121899

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

------- Additional Comments from Alexey Proskuryakov <ap at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=212551&action=review


I think that this is a useful thing to look into. r- for regressing src
preformance though.

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:393
> +	   image.imageURL =
StringImpl::createWithoutCopying(srcsetAttribute.characters() + imageURLStart,
imageURLEnd - imageURLStart);

I'm not really a fan of passing unsafe string across functions. Can we just
record the start and length of the URL as indexes, and only create a string
when needed?

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:425
> +    return String(imageCandidates.last().imageURL.characters(),
imageCandidates.last().imageURL.length());

This adds an extra copy in the common case where we have an src and no srcset.


More information about the webkit-reviews mailing list