-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Optimize Matrix4.identity #22622
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
/cc @dnfield , not sure what the native code looks like for this... Next i'm going to change named default params to use kIdentityMatrix with assert(kIdentityMatrix.isIdentity()) to make sure nobody mutates. |
|
@mraleph is probably better for the native code side than I am, or at least would know someone who can look at this. |
|
We should probably look to apply this change upstream in package:vector_math right? That way the framework will benefit as well (or is the framework using this copy?) |
|
Due to dart:ui not being able import any package, yes its a copy. You are
correct, we should upstream.
…On Thu, Nov 19, 2020 at 4:54 PM Dan Field ***@***.***> wrote:
We should probably look to apply this change upstream in
package:vector_math right? That way the framework will benefit as well (or
is the framework using this copy?)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22622 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGTTKRUKPD23UUG6WEYGZLSQW46FANCNFSM4T4CQCKQ>
.
|
|
VM does not do much, we just emit allocation and |
| /// Copy into [arg]. | ||
| Matrix4 copyInto(Matrix4 arg) { | ||
| final Float32List argStorage = arg._m4storage; | ||
| argStorage[15] = _m4storage[15]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the optimization! Shall we also add a comment about the compiler optimization we are doing(why are we accessing the 15th index before all the others)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
nturgut
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* d6beaed Roll Fuchsia Linux SDK from gkfmiRsIl... to un3JixwuO... (flutter/engine#22744) * 8832b48 Roll Skia from 888c5d3e57eb to 51b74afb84d4 (12 revisions) (flutter/engine#22746) * e890901 Don't register CanvasKit with `define` (flutter/engine#22745) * 3c51679 Roll Skia from 51b74afb84d4 to 452369182f6e (1 revision) (flutter/engine#22749) * 5bf6533 Introduce a delegate class for gpu metal rendering (flutter/engine#22611) * 5131aa4 Roll Skia from 452369182f6e to f2efb80bc316 (4 revisions) (flutter/engine#22750) * 7b5f79f fuchsia: Ensure full-screen input interceptor (flutter/engine#22687) * cec8a6e Manual roll of Dart SDK from ce76503f5b46 to dcd5a8f005a (flutter/engine#22766) * 001a511 Roll Fuchsia Linux SDK from un3JixwuO... to Bnaeivv07... (flutter/engine#22757) * b9615b1 Roll Fuchsia Mac SDK from 36uDTGJQp... to qpkZl0s5J... (flutter/engine#22753) * c4c4763 Roll Skia from f2efb80bc316 to 8d78da910e45 (5 revisions) (flutter/engine#22754) * dbd1abe Roll Dart SDK from dcd5a8f005a2 to 960620d2e811 (794 revisions) (flutter/engine#22768) * 1c2a6bd Fix the unchecked conversion warning for searchPaths in PlayStoreDynamicFeatureManager (flutter/engine#22654) * 81af789 add file package to deps in prep for glob update (flutter/engine#22770) * a35e3fe Let FlutterFragment not pop the whole activity by default when more fragments are in the activity (flutter/engine#22692) * adb3312 Revert "Introduce a delegate class for gpu metal rendering (#22611)" (flutter/engine#22775) * bcc8832 Cleanup dart_runner examples & tests. (flutter/engine#22769) * 609307d Roll Skia from 8d78da910e45 to fd41d878b13d (20 revisions) (flutter/engine#22772) * 587c023 [web] Add new line break type (prohibited) (flutter/engine#22771) * 6b2ed2b Roll Skia from fd41d878b13d to 70fe17e12f38 (6 revisions) (flutter/engine#22776) * 7910a17 Roll Dart SDK from 960620d2e811 to 7a2a3968ef53 (12 revisions) (flutter/engine#22778) * f4ada80 Roll Skia from 70fe17e12f38 to 4c6f57a23e63 (1 revision) (flutter/engine#22781) * 3101dff [web] Optimize Matrix4.identity (flutter/engine#22622) * a4ce848 Add FlutterPlayStoreSplitApplication for simpler opt in to Split AOT (flutter/engine#22752) * 747b791 Add file.dart to DEPS (flutter/engine#22794) * 40fa345 Fix race condition in key event handling on Android (flutter/engine#22658) * d2ad441 Fix PlatformDispatcher.locale to return something meaningful when there are no locales. (flutter/engine#22608)
* d6beaed Roll Fuchsia Linux SDK from gkfmiRsIl... to un3JixwuO... (flutter/engine#22744) * 8832b48 Roll Skia from 888c5d3e57eb to 51b74afb84d4 (12 revisions) (flutter/engine#22746) * e890901 Don't register CanvasKit with `define` (flutter/engine#22745) * 3c51679 Roll Skia from 51b74afb84d4 to 452369182f6e (1 revision) (flutter/engine#22749) * 5bf6533 Introduce a delegate class for gpu metal rendering (flutter/engine#22611) * 5131aa4 Roll Skia from 452369182f6e to f2efb80bc316 (4 revisions) (flutter/engine#22750) * 7b5f79f fuchsia: Ensure full-screen input interceptor (flutter/engine#22687) * cec8a6e Manual roll of Dart SDK from ce76503f5b46 to dcd5a8f005a (flutter/engine#22766) * 001a511 Roll Fuchsia Linux SDK from un3JixwuO... to Bnaeivv07... (flutter/engine#22757) * b9615b1 Roll Fuchsia Mac SDK from 36uDTGJQp... to qpkZl0s5J... (flutter/engine#22753) * c4c4763 Roll Skia from f2efb80bc316 to 8d78da910e45 (5 revisions) (flutter/engine#22754) * dbd1abe Roll Dart SDK from dcd5a8f005a2 to 960620d2e811 (794 revisions) (flutter/engine#22768) * 1c2a6bd Fix the unchecked conversion warning for searchPaths in PlayStoreDynamicFeatureManager (flutter/engine#22654) * 81af789 add file package to deps in prep for glob update (flutter/engine#22770) * a35e3fe Let FlutterFragment not pop the whole activity by default when more fragments are in the activity (flutter/engine#22692) * adb3312 Revert "Introduce a delegate class for gpu metal rendering (#22611)" (flutter/engine#22775) * bcc8832 Cleanup dart_runner examples & tests. (flutter/engine#22769) * 609307d Roll Skia from 8d78da910e45 to fd41d878b13d (20 revisions) (flutter/engine#22772) * 587c023 [web] Add new line break type (prohibited) (flutter/engine#22771) * 6b2ed2b Roll Skia from fd41d878b13d to 70fe17e12f38 (6 revisions) (flutter/engine#22776) * 7910a17 Roll Dart SDK from 960620d2e811 to 7a2a3968ef53 (12 revisions) (flutter/engine#22778) * f4ada80 Roll Skia from 70fe17e12f38 to 4c6f57a23e63 (1 revision) (flutter/engine#22781) * 3101dff [web] Optimize Matrix4.identity (flutter/engine#22622) * a4ce848 Add FlutterPlayStoreSplitApplication for simpler opt in to Split AOT (flutter/engine#22752) * 747b791 Add file.dart to DEPS (flutter/engine#22794) * 40fa345 Fix race condition in key event handling on Android (flutter/engine#22658) * d2ad441 Fix PlatformDispatcher.locale to return something meaningful when there are no locales. (flutter/engine#22608) * b9a0b5e Roll Skia from 4c6f57a23e63 to a927771c9cce (10 revisions) (flutter/engine#22802) * 96d63e5 Roll Dart SDK from 7a2a3968ef53 to e9a03fd98faa (5 revisions) (flutter/engine#22801) * cdf72da Roll Skia from a927771c9cce to 7b776b514933 (3 revisions) (flutter/engine#22803) * a0c8b67 Roll buildroot and benchmark (flutter/engine#22804) * c3c3ec6 Roll Fuchsia Mac SDK from qpkZl0s5J... to 7O11wjLVX... (flutter/engine#22805) * 6625308 Revert "Roll buildroot and benchmark (#22804)" (flutter/engine#22816) * 64d9add Add a golden scenario test for fallback font rendering on iOS take 3 (flutter/engine#22736) * 7d7a260 Add static text trait to plain semantics object with label in iOS (flutter/engine#22811) * 22e1143 Roll Skia from 7b776b514933 to c504ecda03b8 (6 revisions) (flutter/engine#22808) * 65254eb Roll Dart SDK from e9a03fd98faa to 5acaa5f14b03 (1 revision) (flutter/engine#22810) * 3926b21 Roll Fuchsia Linux SDK from Bnaeivv07... to W14Qninrb... (flutter/engine#22817) * 5eb505f Roll Fuchsia Mac SDK from 7O11wjLVX... to Z_-ciOYM9... (flutter/engine#22820) * d85cb10 add trace kernel flag to allowlist (flutter/engine#22812) * 14cb066 [embedder] Compositor can specify that no backing stores be cached (flutter/engine#22780) * eb6eabc Reland "Introduce a delegate class for gpu metal rendering (#22611)" (flutter/engine#22777) * 644dd65 Temporarily reduce e2e test matrix to stop flaky web engine builds (flutter/engine#22824) * 105004d Stop using the List constructor. (flutter/engine#22793) * 34f49a1 Roll Dart SDK from 5acaa5f14b03 to cfaa7606cbf5 (2 revisions) (flutter/engine#22827) * 6c8342f Revert "Fix race condition in key event handling on Android (#22658)" (flutter/engine#22823) * 1c2a8f9 Roll Skia from c504ecda03b8 to 9443d58af292 (16 revisions) (flutter/engine#22828) * b63e911 Better handle image codec instantiation failure (flutter/engine#22809) * 1358fda Generate Maven metadata files for engine artifacts (flutter/engine#22685) * 079c669 Generate gen_snapshot_armv7 and gen_snapshot_arm64 (flutter/engine#22818) * fcbfa9f Split AOT Engine Runtime (flutter/engine#22624) * 24d289e Roll Fuchsia Linux SDK from W14Qninrb... to M_8svVndh... (flutter/engine#22842) * 78b567f Reland: "Fix race condition in key event handling on Android (#22658)" (flutter/engine#22834) * 7d32cea (MacOS) Add FlutterGLCompositor with support for rendering multiple layers (flutter/engine#22782) * a713174 Roll Skia from 9443d58af292 to c7112edbe0f4 (10 revisions) (flutter/engine#22839) * bee352c Roll Dart SDK from cfaa7606cbf5 to 97cfd05b3cb3 (2 revisions) (flutter/engine#22840) * e5f510f [web] Fix event transform between mousedown/up due to mouse move event (flutter/engine#22813) * 04b98dc Roll Fuchsia Mac SDK from Z_-ciOYM9... to DRN4P3zbe... (flutter/engine#22841) * 0e3b2cf Roll Skia from c7112edbe0f4 to d39aec0e40ec (17 revisions) (flutter/engine#22844) * e71c6f4 leaving only html tests (flutter/engine#22846) * 3773835 Make CkPicture resurrectable (flutter/engine#22807) * bd394a1 Roll Skia from d39aec0e40ec to 38921cafe1bb (7 revisions) (flutter/engine#22847) * 66f44c6 Roll Dart SDK from 97cfd05b3cb3 to a37a4d42e53d (4 revisions) (flutter/engine#22849) * bdadaad Add delayed event delivery for Linux. (flutter/engine#22577) * 48befc5 More rename from GPU thread to raster thread (flutter/engine#22819) * 9b1b7f6 Roll Skia from 38921cafe1bb to abcc1ecdfd0c (8 revisions) (flutter/engine#22851) * 14a6fd9 Fix NPE when platform plugin delegate is null (flutter/engine#22852)

Description
Changes Matrix.identity from factory constructor calling zero().setIdentity to named ctor only setting 4 members on matrix.
Compiled JS Code Before:
Code After :
Related Issues
First PR for flutter/flutter#70888.
Tests
Covered by benchmarks.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read [handling breaking changes].