-
Notifications
You must be signed in to change notification settings - Fork 29.7k
add image load benchmark #103459
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
add image load benchmark #103459
Conversation
|
I need to run update-packages --force-upgrade but holding off |
| await Future.wait(<Future<ui.ImmutableBuffer>>[ | ||
| for (String asset in assets) | ||
| rootBundle.load(asset).then((ByteData data) { | ||
| return ui.ImmutableBuffer.fromUint8List(data.buffer.asUint8List()); |
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.
My assumption is once the ImmutableBuffer.fromAsset change lands that'll be added here right?
I don't know if it makes sense to do here or to do in a separate benchmark, but WDYT of having something measuring the time it takes to instantiateImageCodec vs the new API?
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.
Yeah, i would just replace this code and we'd see the skia perf benchmark numbers change all at once.
I don't know if it makes sense to do here or to do in a separate benchmark, but WDYT of having something measuring the time it takes to instantiateImageCodec vs the new API?
Assuming you already have the bytes loaded?
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.
I'm trying to suggest a measurement for getting the immutable buffer, and a measurement for getting an image codec from the buffer.
Your change will eliminate copies on both ends, right?
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.
Well, on one end. I think calling ui.ImmutableBuffer.fromUint8List includes the copy though. The codec doesn't have any more copies that we can eliminate IIRC
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.
ohhh I see now, you're already capturing that by calling ImmutableBuffer.fromUint8List. Ok.
…lutter into add_image_load_benchmark
Adds a benchmark that can be used to show improvements for flutter/engine#32999