WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
74330
XHR should use m_responseTypeCode internally to be consistent with WebKit coding style
https://bugs.webkit.org/show_bug.cgi?id=74330
Summary
XHR should use m_responseTypeCode internally to be consistent with WebKit cod...
Jarred Nicholls
Reported
2011-12-12 14:08:56 PST
XHR should use m_responseTypeCode internally for quicker access
Attachments
Patch
(4.05 KB, patch)
2011-12-12 14:11 PST
,
Jarred Nicholls
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jarred Nicholls
Comment 1
2011-12-12 14:11:10 PST
Created
attachment 118842
[details]
Patch
Alexey Proskuryakov
Comment 2
2011-12-12 20:31:44 PST
Comment on
attachment 118842
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=118842&action=review
> Source/WebCore/ChangeLog:3 > + XHR should use m_responseTypeCode internally for quicker access
Using member variables directly is consistent with preferred WebKit coding style, but this change does't affect performance at all. Please update bug and ChangeLog titles before landing.
Jarred Nicholls
Comment 3
2011-12-13 01:56:22 PST
(In reply to
comment #2
)
> (From update of
attachment 118842
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=118842&action=review
> > > Source/WebCore/ChangeLog:3 > > + XHR should use m_responseTypeCode internally for quicker access > > Using member variables directly is consistent with preferred WebKit coding style, but this change does't affect performance at all. Please update bug and ChangeLog titles before landing.
I will modify the title since the consistency is what really matters - but, calling the same function 3 times in a row instead of accessing the variable directly *is* slower (call stack, etc)...but only marginally in the grand scheme of things.
Jarred Nicholls
Comment 4
2011-12-13 02:15:11 PST
Committed
r102665
: <
http://trac.webkit.org/changeset/102665
>
Jarred Nicholls
Comment 5
2011-12-13 02:26:03 PST
P.S. thanks for the r+ :)
Alexey Proskuryakov
Comment 6
2011-12-13 09:02:30 PST
> calling the same function 3 times in a row instead of accessing the variable directly *is* slower
This is not correct. The generated code is exactly the same in release builds - the function is implicitly inline due to being defined inside class definition.
Jarred Nicholls
Comment 7
2011-12-14 05:56:22 PST
(In reply to
comment #6
)
> > calling the same function 3 times in a row instead of accessing the variable directly *is* slower > > This is not correct. The generated code is exactly the same in release builds - the function is implicitly inline due to being defined inside class definition.
Right, but being implicitly marked as "inline" doesn't mean the optimizer will inline it if it's not worth doing. I disassembled a test case from LLVM and it apparently doesn't always do it. The difference in speed was sub-millisecond. Whoopdie do :)
Alexey Proskuryakov
Comment 8
2011-12-14 08:47:13 PST
Given how this function is used, that sounds like a compiler bug. You used a release build, correct?
Jarred Nicholls
Comment 9
2011-12-14 09:05:21 PST
(In reply to
comment #8
)
> Given how this function is used, that sounds like a compiler bug. You used a release build, correct?
Agreed, it does sound like a bug. Yes it was release build with inline hints turned on. I haven't tried gcc or clang w/ the same.
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