-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] remove obsolete object caches; simplify native object management #40894
Conversation
|
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. |
|
The |
|
Golden file changes are available for triage from new commit, Click here to view. |
CaseyHillers
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 on the Google Testing side
(this is attempt 3; details below)
Remove obsolete object caches and introduce a simpler way to manage native objects:
SynchronousSkiaObjectCache.native_memory.dartthat's smaller and simpler thanskia_object_cache.dart.UniqueRefa reference with a unique Dart object owner.CountedRefa ref-counted reference with multiple Dart object owners.FinalizationRegistry) as a back-up.FinalizationRegistry. All browsers support it now.SkParagraphcache that predates the introduction ofParagraph.dispose.CkParagraphin terms ofUniqueRef.CkImagein terms ofCountedRef; deleteSkiaObjectBox.This PR does not migrate all objects from the old
skia_object_cache.darttonative_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 3
More about attempt 2 here.
In this attempt 3 I'm replacing the
factorywith a top-level function.Benchmarks
Now that this landed in flutter/flutter I have some benchmark numbers from the devicelab. The
text_out_of_picture_boundsbenchmark dropped by 3-4x (lower is better):The repro provided in flutter/flutter#123204 dropped from 110ms/frame to 10ms/frame.