WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 197905
Make LOG_WITH_STREAM more efficient
https://bugs.webkit.org/show_bug.cgi?id=197905
Summary
Make LOG_WITH_STREAM more efficient
Simon Fraser (smfr)
Reported
2019-05-14 23:15:38 PDT
Make LOG_WITH_STREAM more efficient
Attachments
Patch
(8.83 KB, patch)
2019-05-14 23:18 PDT
,
Simon Fraser (smfr)
achristensen
: review+
Details
Formatted Diff
Diff
Patch
(9.45 KB, patch)
2019-05-15 09:52 PDT
,
Simon Fraser (smfr)
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2019-05-14 23:18:44 PDT
Created
attachment 369929
[details]
Patch
Alex Christensen
Comment 2
2019-05-15 07:48:13 PDT
Comment on
attachment 369929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=369929&action=review
> Source/WTF/wtf/text/TextStream.h:109 > + struct repeat { > + repeat(char inCharacter, unsigned inWidth) > + : width(inWidth) > + , character(inCharacter) > + { }
I think this should be named Repeat. I think initializer lists could be used instead of this constructor.
> Source/WebCore/PAL/pal/LogMacros.h:35 > + if (JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel).state == WTFLogChannelState::On) { \
This seems like an obvious check we should've done before.
Simon Fraser (smfr)
Comment 3
2019-05-15 08:41:54 PDT
(In reply to Alex Christensen from
comment #2
)
> Comment on
attachment 369929
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=369929&action=review
> > > Source/WTF/wtf/text/TextStream.h:109 > > + struct repeat { > > + repeat(char inCharacter, unsigned inWidth) > > + : width(inWidth) > > + , character(inCharacter) > > + { } > > I think this should be named Repeat. > I think initializer lists could be used instead of this constructor.
So the call site would look like: stream << Repeat({' ', 10}) << "foopy" ?
Alex Christensen
Comment 4
2019-05-15 09:03:05 PDT
(In reply to Simon Fraser (smfr) from
comment #3
) stream << Repeat {' ', 10} << "foopy"
Simon Fraser (smfr)
Comment 5
2019-05-15 09:24:08 PDT
Sadly the compiler doesn't like initializers inside a macro invocation: /rendering/RenderLayerCompositor.cpp:1176:69: error: too many arguments provided to function-like macro invocation LOG_WITH_STREAM(Compositing, stream << TextStream::Repeat {' ', compositingState.depth * 2} << &layer << " computeCompositingRequirements - willBeComposited " << willBeComposited << " (backing provider candidate " << backingSharingState.backingProviderCandidate() << ")");
Simon Fraser (smfr)
Comment 6
2019-05-15 09:52:11 PDT
Created
attachment 369961
[details]
Patch
Simon Fraser (smfr)
Comment 7
2019-05-15 11:54:28 PDT
https://trac.webkit.org/r245336
Radar WebKit Bug Importer
Comment 8
2019-05-15 11:58:02 PDT
<
rdar://problem/50820136
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug