Repository navigation
Shipping the png crate in Chromium
#562
Replies: 5 comments 26 replies
|
I'm reporting a Chrome bug #391914245 which will cause our site to not be able to decode this apng. |
|
I just wanted to drop a quick note that we've expanded the field trials to 50% of M135/Beta. I've edited the top-level post accordingly. |
|
Rust PNG got approval to launch a 1% Stable experiment in M136. The Stable channel usually ramps up more slowly, but if everything goes smoothly we should have some data in the 2nd half of May. I've edited the top-level post to also cover Stable trials. |
|
🎶 Now these points of data I am happy to share that the M136 data supports shipping Rust PNG to all Chrome users. Thank you very much to all the open source contributors whose work made it possible to ship Rust PNG with minimal performance impact and with no functional bugs so far. Below I am sharing some high-level performance data from the rollout of Rust PNG in Chrome M136 - I hope that this data will be helpful in guiding future performance work. Note that shipping to all Chrome users will be done gradually - initially through field trial configuration and in the long-term by enabling Rust PNG by default and then removing In M136 Rust PNG is disabled by default, but can be enabled through a field trial. The data below is based on enabling Rust PNG for 1% of Chrome Stable release channel, and comparing against a control group which uses the legacy, Decoding runtimeIf enabled through a field trial, Rust PNG is used to decode PNG images used to render web pages, but also to decode other PNG images (favicons, UI elements, etc). The
Encoding performanceIf enabled through a field trial, Rust PNG is used to encode PNG images in various scenarios:
Image encoding speed: mixed results (based on the
Image compression ratio: mixed results (based on the
|
|
https://security.googleblog.com/2025/11/rust-in-android-move-fast-fix-things.html makes it sound like the switch has already happened, citing https://chromium-review.googlesource.com/c/chromium/src/+/6085801 from June. @anforowicz since it's your CL, could you clarify its status? Has that reached the stable channel yet? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I really appreciate all the work that has been put into the
pngcrate (andfdeflatecrate as well as the Rust toolchain and other Rust crates). As a way of saying "thank you", let me share the status (and excitement) of what is going on with shipping thepngcrate in Chromium.History of edits of this post:
We started Chrome Canary experiments in the 2nd half of December 2024, Chrome Dev experiments in the 2nd half of February 2025, and Chrome Beta experiments in the middle of March 2023. We plan to enable Rust PNG for 1% of users of the Stable release channel when M136 ships to that release channel at the end of April.
Below are some additional details in the form of questions and answers. Let me know if you have any other questions.
Q: What Chrome versions participate in the experiments?
For a tentative Chromium release schedule please see https://chromiumdash.appspot.com/schedule.
Q: How can I tell which experiment group I am in?
To find out which experiment group you are in, go to chrome://version and search for “977e3a5f” in the list of “Active Variations”:
Note that getting assigned to one of the experiment groups may depend on getting a new field trials “seed” and therefore may require rebooting a browser. Also note that your local ChromeVariations enterprise policy may limit which field trials you may participate in.
Q: Can I switch to a different experiment group?
You can't pick which experiment group you will be assigned to. Experiment group assignment happens randomly, and is “sticky” / “permanent” for the given Chrome client.
If you want to force Rust
pngon or off (e.g. to triage if the field trial may be responsible for a bug), then navigate to chrome://flags/#rusty-png and force the flag to be enabled or disabled. Note that this will exclude you from the A/B comparisons (i.e. you will be assigned to “ForcedOn_…” or “ForcedOff_…” group, rather than to the control or the experiment group).Q: What versions of the libraries are covered?
libpng/zlib-based decoders and encoders that normally ship in Chromiumblink::PNGImageDecoderSkPngDecoder(used mostly through//ui/gfx/codec/png_codec.hAPI)SkPngEncoder(used mostly through//ui/gfx/codec/png_codec.hAPI)pngcrateSkPngRustDecoderandSkPngRustEncoderpngversion: 0.18.0-rc;fdeflateversion: 0.3.7; see also Chromium’sCargo.lock.Q: Can you share performance results from the field trials?
Yes, I plan to share aggregate performance numbers. OTOH, I want to wait until we have results from the Stable channel, because:
Preliminary M135/Canary+Dev data shows decoding runtime improvement on Desktop, and a regression on Mobile/ARM. Encoding performance results are similarly mixed, but in the other direction. These 2 aspects should get a bit better in M136 thanks to http://review.skia.org/962878, https://crrev.com/c/6333255, and https://crrev.com/c/6354419.
Disclaimer: Let me also note various factors that may impact the performance results (and therefore explain if/why Chromium numbers may not match other measurements):
zlibthat uses SIMD for better performance (and therefore other results comparing acrosslibpngand Rust PNG may not necessarily carry over to this A/B experiment in Chromium)libpngorpngcrate are not used bySkPngDecodernorSkPngRustDecoder, because (unlikeblink::PNGImageDecoder) Skia applies alpha premultiplication and color space transformations to <=256 pixels of the palette, rather than to N pixels of the image.All reactions