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

Benchmarks for the backend #16

Open
asomers opened this issue Nov 2, 2021 · 2 comments
Open

Benchmarks for the backend #16

asomers opened this issue Nov 2, 2021 · 2 comments

Comments

@asomers
Copy link
Owner

asomers commented Nov 2, 2021

I spent a little time this evening to explore benchmarks for the backend, but this being a binary only crate I cannot figure out how to call any code from the linux module outside of the binary crate itself :/

Originally posted by @guygastineau in #13 (comment)

@asomers
Copy link
Owner Author

asomers commented Nov 2, 2021

One option is to create a #[bench] function within a #[cfg(test)] module directly within the binary itself. There's no rule that benchmarks must live in a "benches" directory.

@guygastineau
Copy link

I did try that (after adding the appropriate feature flag to the crate root), but there were some strange errors. The bench functions didn't have access to the code in my module. I'll have to try again. I think I put the bench functions in the test module. Should the be in the top level of the module where they want to access definitions?

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

No branches or pull requests

2 participants