RESOLVED FIXED101828
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
Patch (6.01 KB, patch)
2012-11-16 16:57 PST, Benjamin Poulain
no flags
Patch (6.02 KB, patch)
2012-11-16 19:42 PST, Benjamin Poulain
simon.fraser: review+
Benjamin Poulain
Comment 1 2012-11-09 21:09:44 PST
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
Early Warning System Bot
Comment 5 2012-11-16 17:11:02 PST
Early Warning System Bot
Comment 6 2012-11-16 17:12:40 PST
kov's GTK+ EWS bot
Comment 7 2012-11-16 17:23:08 PST
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
EFL EWS Bot
Comment 11 2012-11-16 19:04:16 PST
Benjamin Poulain
Comment 12 2012-11-16 19:42:16 PST
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
Note You need to log in before you can comment on or make changes to this bug.