Overhaul bezier curve benchmarks#17016
Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom Dec 29, 2024
Merged
Conversation
- Apply `bench!` macro to all names - Rename benchmarks to be more descriptive of what they do - Deduplicate `build_pos_cubic()` and `build_accel_cubic()`, since they both benchmark the exact same thing! - Move calculation of time for curve easing outside main routine - Move `curve.position()` benchmarks under the same group, and make their routine generic - Remove unnecessary `Vec` allocation from `build_pos_cubic()`
BenjaminBrienen
approved these changes
Dec 29, 2024
IQuick143
approved these changes
Dec 29, 2024
Contributor
IQuick143
left a comment
There was a problem hiding this comment.
Not entirely familiar with the benchmarking APIs, but the changes all seem reasonable.
auto-merge was automatically disabled
December 29, 2024 20:39
Head branch was pushed to by a user without write access
Member
|
Thanks for formatting this for me: manual merge conflict resolution often causes that failure. |
Member
Author
No problem! |
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective - Part of bevyengine#16647. - The benchmarks for bezier curves have several issues and do not yet use the new `bench!` naming scheme. ## Solution - Make all `bevy_math` benchmarks use the `bench!` macro for their name. - Delete the `build_accel_cubic()` benchmark, since it was an exact duplicate of `build_pos_cubic()`. - Remove `collect::<Vec<_>>()` call in `build_pos_cubic()` and replace it with a `for` loop. - Combine all of the benchmarks that measure `curve.position()` under a single group, `curve_position`, and extract the common bench routine into a helper function. - Move the time calculation for the `curve.ease()` benchmark into the setup closure so it is not tracked. - Rename the benchmarks to be more descriptive on what they do. - `easing_1000` -> `segment_ease` - `cubic_position_Vec2` -> `curve_position/vec2` - `cubic_position_Vec3A` -> `curve_position/vec3a` - `cubic_position_Vec3` -> `curve_position/vec3` - `build_pos_cubic_100_points` -> `curve_iter_positions` ## Testing - `cargo test -p benches --bench math` - `cargo bench -p benches --bench math` - Then open `./target/criterion/report/index.html` to see the report! --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
mrchantey
pushed a commit
to mrchantey/bevy
that referenced
this pull request
Feb 4, 2025
# Objective - Part of bevyengine#16647. - The benchmarks for bezier curves have several issues and do not yet use the new `bench!` naming scheme. ## Solution - Make all `bevy_math` benchmarks use the `bench!` macro for their name. - Delete the `build_accel_cubic()` benchmark, since it was an exact duplicate of `build_pos_cubic()`. - Remove `collect::<Vec<_>>()` call in `build_pos_cubic()` and replace it with a `for` loop. - Combine all of the benchmarks that measure `curve.position()` under a single group, `curve_position`, and extract the common bench routine into a helper function. - Move the time calculation for the `curve.ease()` benchmark into the setup closure so it is not tracked. - Rename the benchmarks to be more descriptive on what they do. - `easing_1000` -> `segment_ease` - `cubic_position_Vec2` -> `curve_position/vec2` - `cubic_position_Vec3A` -> `curve_position/vec3a` - `cubic_position_Vec3` -> `curve_position/vec3` - `build_pos_cubic_100_points` -> `curve_iter_positions` ## Testing - `cargo test -p benches --bench math` - `cargo bench -p benches --bench math` - Then open `./target/criterion/report/index.html` to see the report! --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
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.
Objective
bench!naming scheme.Solution
bevy_mathbenchmarks use thebench!macro for their name.build_accel_cubic()benchmark, since it was an exact duplicate ofbuild_pos_cubic().collect::<Vec<_>>()call inbuild_pos_cubic()and replace it with aforloop.curve.position()under a single group,curve_position, and extract the common bench routine into a helper function.curve.ease()benchmark into the setup closure so it is not tracked.easing_1000->segment_easecubic_position_Vec2->curve_position/vec2cubic_position_Vec3A->curve_position/vec3acubic_position_Vec3->curve_position/vec3build_pos_cubic_100_points->curve_iter_positionsTesting
cargo test -p benches --bench mathcargo bench -p benches --bench math./target/criterion/report/index.htmlto see the report!