This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Revert "[web] remove obsolete object caches; simplify native object management" #40937
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XilaiZhang
approved these changes
Apr 5, 2023
Contributor
|
All failures are in Firefox 72, which we do not support. |
yjbanov
approved these changes
Apr 5, 2023
Contributor
|
just to verify, Yegor is okay with a revert right? |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
Contributor
|
The golden seems to be another Impeller flake. Let's land this. |
Contributor
|
Look at Yegor -- so efficient! |
This was referenced Apr 5, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 5, 2023
…e object management" (flutter/engine#40937)
CaseyHillers
pushed a commit
to flutter/flutter
that referenced
this pull request
Apr 5, 2023
…124200) flutter/engine@4219c72...db23c3f 2023-04-05 [email protected] [Impeller] Snap glyph positions to screen space pixels and map UVs correctly (flutter/engine#40912) 2023-04-05 [email protected] [macOS] Handle termination in FlutterAppDelegate (flutter/engine#40929) 2023-04-05 [email protected] Manual roll Dart SDK from f97b9d9b2f64 to beff36793081 (1 revision) (flutter/engine#40934) 2023-04-05 [email protected] Revert "[web] remove obsolete object caches; simplify native object management" (flutter/engine#40937) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
yjbanov
added a commit
that referenced
this pull request
Apr 5, 2023
(this is attempt 4; details below) Remove obsolete object caches and introduce a simpler way to manage native objects: * Remove the unused `SynchronousSkiaObjectCache`. * Introduce new library `native_memory.dart` that's smaller and simpler than `skia_object_cache.dart`. * Introduce two types of native object references: * `UniqueRef` a reference with a unique Dart object owner. * `CountedRef` a ref-counted reference with multiple Dart object owners. * All native references use GC (via `FinalizationRegistry`) as a back-up. * The new library removes everything related to object resurrection that was needed only in browsers that didn't support `FinalizationRegistry`. All browsers support it now. * Remove the ad hoc `SkParagraph` cache that predates the introduction of `Paragraph.dispose`. * Rewrite `CkParagraph` in terms of `UniqueRef`. * Rewrite `CkImage` in terms of `CountedRef`; delete `SkiaObjectBox`. This PR does not migrate all objects from the old `skia_object_cache.dart` to `native_memory.dart`. That would be too big of a change. The migration can be done in multiple smaller PRs. This also removes a few unnecessary relayouts observed in flutter/flutter#120921, but not all of them (more details in flutter/flutter#120921 (comment)) ## About attempt 4 More info about the revert of attempt 3 in #40937. In this attempt I check that the browser supports `FinalizationRegistry` before registering the object. This will allow the code to run in older browsers, but there will be no protection from memory leaks when the app fails to dispose of the respective objects. ## Benchmarks Now that this landed in flutter/flutter I have some benchmark numbers from the devicelab. The `text_out_of_picture_bounds` benchmark dropped by 3-4x (lower is better): <img width="358" alt="Screenshot 2023-04-04 at 6 13 06 PM" src="https://user-images.githubusercontent.com/211513/229956170-a5399ed3-c779-4af0-babb-ea40440f96ff.png"> The repro provided in flutter/flutter#123204 dropped from 110ms/frame to 10ms/frame.
exaby73
pushed a commit
to NevercodeHQ/flutter
that referenced
this pull request
Apr 17, 2023
…lutter#124200) flutter/engine@4219c72...db23c3f 2023-04-05 [email protected] [Impeller] Snap glyph positions to screen space pixels and map UVs correctly (flutter/engine#40912) 2023-04-05 [email protected] [macOS] Handle termination in FlutterAppDelegate (flutter/engine#40929) 2023-04-05 [email protected] Manual roll Dart SDK from f97b9d9b2f64 to beff36793081 (1 revision) (flutter/engine#40934) 2023-04-05 [email protected] Revert "[web] remove obsolete object caches; simplify native object management" (flutter/engine#40937) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
platform-web
Code specifically for the web engine
will affect goldens
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #40894
This is breaking Google Testing. See b/277004090