Shipping the png
crate in Chromium
#562
anforowicz
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I really appreciate all the work that has been put into the
png
crate (andfdeflate
crate 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 thepng
crate in Chromium.We started Chrome Canary experiments in the 2nd half of December 2024. I initially planned to also start Dev experiments and try shipping in M133, but it took me longer than expected to fully hook up the encoder. I hope to start Dev experiments in early January and try shipping in M134.
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?
We don’t have enough experimental data to ship in M133, but depending on the experiment results on earlier channels, we plan to expand to M134 Dev, Beta, and Stable during Q1 2025. 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
png
on 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::PNGImageDecoder
SkPngDecoder
(used mostly through//ui/gfx/codec/png_codec.h
API)SkPngEncoder
(used mostly through//ui/gfx/codec/png_codec.h
API)png
crateSkPngRustDecoder
andSkPngRustEncoder
png
version: 0.17.16;fdeflate
version: 0.3.7; see also Chromium’sCargo.lock
. TODO: edit this when M134 branch is created.unstable
crate feature of thepng
crate (i.e. usesstd::simd
in thepng
crate and specialized instructions incrc32fast
crate). (In general, Chromium uses “nightly” versions of rustc and clang as soon as they pass project-specific tests.)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:
The M133/Canary data does not have great statistical power, but nevertheless seems to show that Rust is a bit slower than C/C++ in the Renderer4.ImageDecodeTaskDurationUs.Png.Software metric. Furthermore this translates into regressions in WebVitals.FirstContentfulPaint4 and WebVitals.LargestContentfulPaint3 metrics which will get scrutinized when deciding whether to ship. I hope to address this by experimenting with different sizes of
fdeflate
tables (see here and here).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):
zlib
that uses SIMD for better performance (and therefore other results comparing acrosslibpng
and Rust PNG may not necessarily carry over to this A/B experiment in Chromium)-Coverflow-checks=on
even in official, release builds. Onlyfdeflate
crate is opted out.libpng
orpng
crate are not used bySkPngDecoder
norSkPngRustDecoder
, 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.Beta Was this translation helpful? Give feedback.
All reactions