Add CodSpeed performance benchmarks - #1
Merged
Conversation
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Collaborator
|
@codspeedbot Can you add webp encoding benches as well? |
Author
Added a
Notes on a couple of choices:
Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
Adds benches/webp.rs covering the --webp and --webp_single paths: the full animated WebP encode, libwebp serialization of already composited frames, and single-frame lossy and lossless encoding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up continuous performance measurement with CodSpeed for the rendering pipeline.
What was added
benches/— 16 divan benchmarks (viacodspeed-divan-compat, renamed todivan), split into three suites. They live in the root crate because that is where the shipped templates, example photos and fonts are;maple-render-coredeliberately bundles none of them, and the benchmarks exercise its public API through themaplere-exports.render.rs— template archive parsing (open_template), PNG layer decoding (decode_frame_layers), frame compositing in both qualities (composite_sampled,composite_simple,composite_multi_layer), the downscale/letterbox pass (composite_scaled) and the point-cloud scan behind--auto_zoom(frame_cloud).quantize.rs— median-cut palette construction (build_palette) and palette mapping with a cold cache, a warm cache and Floyd-Steinberg dithering, which is what each animation frame goes through.pipeline.rs— the end-to-end work of a real invocation: full animated GIF with and without dithering, GIF serialization on its own, JPEG input decoding and text-layer rasterization..github/workflows/codspeed.yml— runs on pushes totrunk/main, on pull requests and onworkflow_dispatch, usingCodSpeedHQ/action@v5insimulationmode with OIDC authentication. It follows the existing CI conventions (actions/checkout@v4,dtolnay/rust-toolchain@stable,Swatinem/rust-cache@v2).Cargo.toml— acodspeedprofile inheritingrelease, with debug symbols kept for readable flame graphs andpanic = "unwind", because a benchmark harness cannot be built with thepanic = "abort"of the release profile.README.md— CodSpeed badge and a short section on running the benchmarks locally.Two things worth knowing
-C target-cpu=nativeand the CPU simulator..cargo/config.tomlbuilds withtarget-cpu=native; on these runners that emits AVX-512 instructions the simulator cannot execute (the first local run died with SIGILL). The workflow therefore setsRUSTFLAGS: -C target-cpu=x86-64-v3, which keeps AVX2-era codegen and has the side benefit of making measurements comparable across machines.RAYON_NUM_THREADS=1(set inbenches/common/mod.rs, overridable from the environment) and warm the pool once before measuring, so lazy pool initialization stays out of the first measured iteration.Verified locally
codspeed run --mode simulation -- cargo codspeed runmeasured all 16 benchmarks with profiling data for each, in about 45 seconds.cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --locked --liball pass with the new files.Next steps
trunkso CodSpeed records a baseline; later pull requests then get a comparison against it.webp_anim, behind the defaultwebpfeature) and the--vidpath, which needs ffmpeg on the runner.