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.
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.
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.
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.
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.
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