RESOLVED FIXED 137978
Avoid repeated is<MutableStyleProperties>() checks in StyleProperties
https://bugs.webkit.org/show_bug.cgi?id=137978
Summary Avoid repeated is<MutableStyleProperties>() checks in StyleProperties
Chris Dumez
Reported 2014-10-22 12:30:53 PDT
We can reduce the amount of is<MutableStyleProperties>() checks in StyleProperties by removing the checks in each method of StyleProperties::PropertyReference, and replace them by a single check in StyleProperties::propertyAt(). We can also provide faster propertyCount() / propertyAt() / isEmpty() methods on MutableStyleProperties / ImmutableStyleProperties as a lot of callers use tight typing.
Attachments
Patch (11.27 KB, patch)
2014-10-22 12:38 PDT, Chris Dumez
no flags
Patch (11.34 KB, patch)
2014-10-22 13:31 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2014-10-22 12:38:10 PDT
Andreas Kling
Comment 2 2014-10-22 13:27:41 PDT
Comment on attachment 240290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240290&action=review r=me! > Source/WebCore/css/StyleProperties.cpp:114 > + for (unsigned i = 0; i < immutableOther.propertyCount(); ++i) I'd cache the propertyCount() in a local.
Chris Dumez
Comment 3 2014-10-22 13:28:55 PDT
Comment on attachment 240290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240290&action=review >> Source/WebCore/css/StyleProperties.cpp:114 >> + for (unsigned i = 0; i < immutableOther.propertyCount(); ++i) > > I'd cache the propertyCount() in a local. In this case, I don't think there is a performance impact as it is inlined but OK, it is good practice.
Chris Dumez
Comment 4 2014-10-22 13:31:14 PDT
WebKit Commit Bot
Comment 5 2014-10-22 14:16:46 PDT
Comment on attachment 240292 [details] Patch Clearing flags on attachment: 240292 Committed r175067: <http://trac.webkit.org/changeset/175067>
WebKit Commit Bot
Comment 6 2014-10-22 14:16:51 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.