Bug 102309 - Coordinated Graphics: A Minor optimization of calculating transforms in CoordinagedGraphicsLayer.
Summary: Coordinated Graphics: A Minor optimization of calculating transforms in Coord...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dongseong Hwang
URL:
Keywords:
Depends on:
Blocks: 102313
  Show dependency treegraph
 
Reported: 2012-11-14 17:59 PST by Dongseong Hwang
Modified: 2012-11-15 17:24 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.74 KB, patch)
2012-11-14 18:00 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (3.82 KB, patch)
2012-11-15 03:15 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (3.82 KB, patch)
2012-11-15 16:24 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2012-11-14 17:59:24 PST
We calculate an inverse transform each tiledBackingStoreVisibleRect() call by a TiledBackingStore and every tiles.
This patch caches the inverse transform to reuse it.
Comment 1 Dongseong Hwang 2012-11-14 18:00:46 PST
Created attachment 174304 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-11-14 23:36:59 PST
Comment on attachment 174304 [details]
Patch

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

> Source/WebKit2/ChangeLog:8
> +        We calculate an inverse transform each tiledBackingStoreVisibleRect() call by
> +        a TiledBackingStore and every tiles.
> +        This patch caches the inverse transform to reuse it.

anyway we can assert to make sure it is always updated before use?
Comment 3 Dongseong Hwang 2012-11-15 03:15:57 PST
Created attachment 174391 [details]
Patch
Comment 4 Dongseong Hwang 2012-11-15 03:16:41 PST
Comment on attachment 174304 [details]
Patch

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

>> Source/WebKit2/ChangeLog:8
>> +        This patch caches the inverse transform to reuse it.
> 
> anyway we can assert to make sure it is always updated before use?

Thanks for review!

That's good idea! I'll update.
Comment 5 Dongseong Hwang 2012-11-15 03:17:00 PST
(In reply to comment #3)
> Created an attachment (id=174391) [details]
> Patch

Add ASSERT :)
Comment 6 Kenneth Rohde Christiansen 2012-11-15 04:45:24 PST
Comment on attachment 174391 [details]
Patch

Do you have any performance data? like how much of an improvement is it? We normally require that
Comment 7 kov's GTK+ EWS bot 2012-11-15 10:15:40 PST
Comment on attachment 174391 [details]
Patch

Attachment 174391 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/14831845
Comment 8 Dongseong Hwang 2012-11-15 16:19:12 PST
(In reply to comment #6)
> (From update of attachment 174391 [details])
> Do you have any performance data? like how much of an improvement is it? We normally require that

Fortunately, I can get the data in my machine (Intel® Xeon(R) CPU X5650 @ 2.67GHz × 6).
In morphing cubes demo (https://www.webkit.org/blog-files/3d-transforms/morphing-cubes.html), when we push "toggle shape" button, CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect() is called.

At the moment,
CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly() takes 118ns.
CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect() taske 65ns.
It means inverse transform takes 55% of times during whole CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly() process.
Inverse transform is heavier than what I expected.

However, this patch does not improve morphing cubes demo's performance because all layers have just one tile.
If we have large layers with 3d transform animation, this patch increase performance fairly.
Comment 9 Dongseong Hwang 2012-11-15 16:24:13 PST
Created attachment 174548 [details]
Patch
Comment 10 Dongseong Hwang 2012-11-15 16:25:01 PST
patch due to flaky gtk ews fail.
Comment 11 WebKit Review Bot 2012-11-15 17:22:37 PST
Comment on attachment 174548 [details]
Patch

Clearing flags on attachment: 174548

Committed r134868: <http://trac.webkit.org/changeset/134868>
Comment 12 WebKit Review Bot 2012-11-15 17:22:41 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Dongseong Hwang 2012-11-15 17:24:48 PST
Thank Kenneth and noam for review! :)