WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
101828
Improve the performance of rect transform
https://bugs.webkit.org/show_bug.cgi?id=101828
Summary
Improve the performance of rect transform
Benjamin Poulain
Reported
2012-11-09 20:33:50 PST
First step: improvement for all hardware.
Attachments
Patch
(3.24 KB, patch)
2012-11-09 21:09 PST
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(6.01 KB, patch)
2012-11-16 16:57 PST
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(6.02 KB, patch)
2012-11-16 19:42 PST
,
Benjamin Poulain
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2012-11-09 21:09:44 PST
Created
attachment 173434
[details]
Patch
Brent Fulgham
Comment 2
2012-11-15 18:22:52 PST
Comment on
attachment 173434
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=173434&action=review
These changes seem very useful -- thanks for looking into this! Both changes are effectively inlining the mapQuad/mapPoint logic to avoid the cost of the "isIdentityOrTranslation()" call. Do you think we could make a helper function that didn't call this method, and have the full fledged mapQuad/mapPoint check for identity, then call this internal function? That way, we could reuse the same logic in both places without paying the high cost you identified in your change.
> Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:702 > + return result.boundingBox();
This is just an inline of mapQuad (and subsequent mapPoints) without the identity/translation check. What if we had a mapQuadNoCheck (or mapQuadImpl) that we could call here (since we've already tested for identity/translation). Then we could share the code here and in the mapQuad call.
> Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:717 > + result.setP1(FloatPoint(x, y));
This is just an inline of mapPoint that doesn't do the identity check. What if we made a mapPointNoCheck (or something) that could be used here, and inside the real "mapPoint" call?
Benjamin Poulain
Comment 3
2012-11-15 18:52:27 PST
(In reply to
comment #2
)
> (From update of
attachment 173434
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=173434&action=review
> > These changes seem very useful -- thanks for looking into this! Both changes are effectively inlining the mapQuad/mapPoint logic to avoid the cost of the "isIdentityOrTranslation()" call. Do you think we could make a helper function that didn't call this method, and have the full fledged mapQuad/mapPoint check for identity, then call this internal function? > > That way, we could reuse the same logic in both places without paying the high cost you identified in your change.
The two function are a little different. In the case of Quad, you really have 8 coordinates, for a rect, you only have 4. That matters because you can remove a number of relatively costly instructions. The next step is to break into pieces to do fewer operation in the case of the rect. I could have done that in this patch but I wanted to keep it trivial (hoping for a fast review :)). Then for ARM, I should implement them in assembly to take advantage of the structure we have in TransformationMatrix.
> > Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:702 > > + return result.boundingBox(); > > This is just an inline of mapQuad (and subsequent mapPoints) without the identity/translation check. What if we had a mapQuadNoCheck (or mapQuadImpl) that we could call here (since we've already tested for identity/translation). Then we could share the code here and in the mapQuad call.
Check again, this is not exactly inline of mapQuad :)
> > Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:717 > > + result.setP1(FloatPoint(x, y)); > > This is just an inline of mapPoint that doesn't do the identity check. What if we made a mapPointNoCheck (or something) that could be used here, and inside the real "mapPoint" call?
Yep, that sounds like a good idea.
Benjamin Poulain
Comment 4
2012-11-16 16:57:45 PST
Created
attachment 174783
[details]
Patch
Early Warning System Bot
Comment 5
2012-11-16 17:11:02 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/14873320
Early Warning System Bot
Comment 6
2012-11-16 17:12:40 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/14857827
kov's GTK+ EWS bot
Comment 7
2012-11-16 17:23:08 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass gtk-ews (gtk): Output:
http://queues.webkit.org/results/14876101
WebKit Review Bot
Comment 8
2012-11-16 17:54:41 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/14860460
Benjamin Poulain
Comment 9
2012-11-16 18:39:09 PST
Comment on
attachment 174783
[details]
Patch Forgot to close a parenthesis on the update.
EFL EWS Bot
Comment 10
2012-11-16 18:46:58 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/14861409
EFL EWS Bot
Comment 11
2012-11-16 19:04:16 PST
Comment on
attachment 174783
[details]
Patch
Attachment 174783
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/14857842
Benjamin Poulain
Comment 12
2012-11-16 19:42:16 PST
Created
attachment 174798
[details]
Patch
Simon Fraser (smfr)
Comment 13
2012-11-16 19:59:26 PST
Comment on
attachment 174798
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=174798&action=review
> Source/WebCore/platform/graphics/transforms/TransformationMatrix.h:382 > + FloatPoint mapPointImpl(const FloatPoint& sourcePoint) const
I'm not a huge fan of mapPointImpl(). Maybe internalMapPoint()?
Benjamin Poulain
Comment 14
2012-11-16 22:09:09 PST
> > Source/WebCore/platform/graphics/transforms/TransformationMatrix.h:382 > > + FloatPoint mapPointImpl(const FloatPoint& sourcePoint) const > > I'm not a huge fan of mapPointImpl(). Maybe internalMapPoint()?
Sounds good to me. I'll update the patch. Thanks for the review.
Benjamin Poulain
Comment 15
2012-11-16 22:30:46 PST
Committed
r135038
: <
http://trac.webkit.org/changeset/135038
>
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