[webkit-reviews] review granted: [Bug 239427] Use AtomString as early as possible when string will eventually get atomized : [Attachment 457763] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 18 09:54:33 PDT 2022
Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 239427: Use AtomString as early as possible when string will eventually get
atomized
https://bugs.webkit.org/show_bug.cgi?id=239427
Attachment 457763: Patch
https://bugs.webkit.org/attachment.cgi?id=457763&action=review
--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 457763
--> https://bugs.webkit.org/attachment.cgi?id=457763
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=457763&action=review
>From bindings we could have AtomString&& instead of const AtomString& for cases
where we are taking ownership and want to save some reference count churn. Not
sure how important this is to performance, but it is an optimization
possibility.
> Source/WebCore/svg/SVGLengthValue.cpp:276
> + StringBuilder builder;
> + builder.append(m_valueInSpecifiedUnits,
lengthTypeToString(m_lengthType));
> + return builder.toAtomString();
We should create makeAtomString for cases like this one. It’s a bit wasteful to
use StringBuilder when we know everything up front, and it’s not too hard to
write a makeAtomString.
More information about the webkit-reviews
mailing list