-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External sizes #35813
External sizes #35813
Conversation
flutter/flutter#110627 landed, marking this for submission |
Looks like SkiaPerf may have recorded an improvement to the image loading microbenchmark on this change: https://flutter-flutter-perf.skia.org/e/?begin=1662091375&end=1662597816&keys=Xbcbcc704c2a3c4734d9c7ca44bc15cc9&requestType=0&selected=commit%3D30900%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dandroid-24%252Chost_type%253Dmac%252Csub_result%253Dimage_load_ms%252Ctest%253Dmicrobenchmarks%252C&xbaroffset=30900 |
I was going to say this is surprising, since we already removed that code for images - but that benchmark is actually testing the time it takes to load an |
(@jonahwilliams fyi) |
Drops
GetAllocationSize
everywhere.Instead, just provide the shallow size of the native peer to the VM.
The problem with reporting the "deep" size is that we often were getting it wrong (even to the point of just completely making a number up). This causes less predictability in GC, and after https://dart-review.googlesource.com/c/sdk/+/256201 reporting too large of a size could cause the VM to refuse to let us allocate the weak handle/finalizer.
Instead, we should just be eagerly disposing of objects when we are done and not relying on GC to clean them up.
This patch should not be landed until flutter/flutter#110627 or something like it lands, since we'd be in a spot where paragraphs would both cause less GC pressure and not get disposed of properly without it (right now we rely on the GC pressure to collect paragraph objects).