Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for benchmarking #201

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Add support for benchmarking #201

merged 1 commit into from
Aug 21, 2024

Conversation

dbittman
Copy link
Contributor

@dbittman dbittman commented Aug 20, 2024

This PR adds support for the unstable bench framework that's part of rust's test system. The following changes were made:

  1. Add a --benches flag to xtask's start-qemu command. This works similar to --tests, but sets up the test binaries to be invoked for benchmarking.
  2. Modifies rust to add support for the math library (benchmarks need math functions, we don't link against libm by default because we don't have libc, so I had to bump compiler_builtins to a version that exposes its math library).

With this PR, a programmer can add #[bench] attributes to test functions and use the benchmarking system. These then get run as part of the test system if --benches is supplied. The results are, for now, only printed, and not used as part of CI.

@dbittman dbittman added the enhancement New feature or request label Aug 20, 2024
@dbittman dbittman requested a review from PandaZ3D August 20, 2024 20:30
@dbittman dbittman self-assigned this Aug 20, 2024
@dbittman dbittman requested a review from gvnn3 as a code owner August 20, 2024 20:30
Copy link
Contributor

@gvnn3 gvnn3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straightforward. Merge it in.

@dbittman dbittman merged commit 67a5575 into main Aug 21, 2024
1 check passed
@dbittman dbittman deleted the dbittman-benches branch August 21, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants