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
Allow profile to be used in cfg
s
#3803
Comments
@alexcrichton See any downsides to exposing the profile this way? This seems like a good "mentored PR" situation. |
Unfortunately there's not actually a great way to implement this. Libraries are compiled in either dev or release, they're never compiled with a "bench" option to get linked against. This is due to Cargo's caching strategy where it caches builds of a library between @torkleyy is it possible to use a separate crate for this, or use support in |
I am already using |
I'm going to go ahead and close out the issue as written, since as @alexcrichton points out, we're specifically avoiding a separate compilation step for libraries when benchmarking, and it doesn't seem like that's something we'd want to change. |
Is there any workaround for this in 2022? |
Only using an "unstable" feature flag and enable it when you're benchmarking, afaik. |
I've created a topic on irlo: https://internals.rust-lang.org/t/ability-to-detect-profiles/19794 In a nutshell I think that this question was closed preemptively. |
It would be nice to have something like
That is helpful if you want to benchmark something internal of the library without exporting it globally.
The text was updated successfully, but these errors were encountered: