Bug 177028 - Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
Summary: Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 30342
  Show dependency treegraph
 
Reported: 2017-09-15 16:53 PDT by Said Abou-Hallawa
Modified: 2019-02-03 11:11 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.62 KB, patch)
2017-09-15 16:55 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (1.64 KB, patch)
2017-09-15 17:26 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (1.64 KB, patch)
2017-09-15 18:44 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-09-15 16:53:00 PDT
From instrumenting the MotionMark Focus test with fixed complexity, this function alone takes 2% of the execution time.
Comment 1 Said Abou-Hallawa 2017-09-15 16:55:48 PDT
Created attachment 320969 [details]
Patch
Comment 2 Tim Horton 2017-09-15 17:10:49 PDT
Comment on attachment 320969 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=320969&action=review

> Source/WebCore/ChangeLog:8
> +        String::fromat() is a bigger hammer for what we need to do in this function.

FROMAT

> Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:71
> +    static NeverDestroyed<String> filterNamePrefix ="filter_";

There's a missing space after the =. Also isn't there a way to make this more efficient b/c it comes from a literal (something like ASCIILiteral? or does that just happen magically? I don't know. Look around.)
Comment 3 Said Abou-Hallawa 2017-09-15 17:26:50 PDT
Created attachment 320976 [details]
Patch
Comment 4 Said Abou-Hallawa 2017-09-15 18:44:38 PDT
Created attachment 320984 [details]
Patch
Comment 5 WebKit Commit Bot 2017-09-15 19:26:48 PDT
Comment on attachment 320984 [details]
Patch

Clearing flags on attachment: 320984

Committed r222125: <http://trac.webkit.org/changeset/222125>
Comment 6 WebKit Commit Bot 2017-09-15 19:26:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Sam Weinig 2017-09-17 15:18:38 PDT
Comment on attachment 320984 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=320984&action=review

> Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:74
> +        String filterName = filterNamePrefix.get() + String::number(i);

For the future, this could be make more efficient by doing:

#include <wtf/text/StringConcatenate.h>
#include <wtf/text/StringConcatenateNumbers.h>

auto filterName = makeString("filter_", i);
Comment 8 Radar WebKit Bug Importer 2017-09-27 12:41:37 PDT
<rdar://problem/34693768>