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

test: avoid compiler optimization of benchmarks #31

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

AaronFeickert
Copy link
Collaborator

It's generally possible for the compiler to optimize benchmarks, which is not what we want.

This PR puts each benchmark operation in a black_box wrapper to (attempt to) avoid this.

@AaronFeickert AaronFeickert merged commit 0c16666 into tari-project:main Jan 10, 2024
6 checks passed
@AaronFeickert AaronFeickert deleted the bench-black-box branch January 10, 2024 22:30
@AaronFeickert
Copy link
Collaborator Author

After further investigation, it appears that the wrapper is already applied.

AaronFeickert added a commit that referenced this pull request Jan 11, 2024
This PR switches benchmarks from `iter` to `iter_batched_ref` so as not to time transcript cloning. It also removes the `black_box` wrappers introduced in #31, which are [unnecessary](#31 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant