-
Notifications
You must be signed in to change notification settings - Fork 84
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
Performance regresssion with (&'static str, &'static str) label set. #248
Comments
|
Appreciate your curiosity! On a high level, I don't think it matters for a user whether an operation takes 40 or 20 nano seconds here. That said, indeed, this is counterintuitive. But I am not able to reproduce it:
Are you able to reproduce |
Yep. Unfortunately, it is a stable regression with my machine. I'm running the benchmark with |
I agree that 20+ ns vs 15+ ns looks close digitally, but the overhead is 33% more in ratio. 🥹 |
BTW, can I open a PR to add the test case? |
Maybe use https://play.rust-lang.org/ to take a look at the ASM and LLVM IR code. The reason might be obvious from there?
I don't think the test itself, without an explanation for the regression would be helpful. |
Hi, thanks for building the Prometheus client in Rust. Really love it.
When doing the benchmark, I added another test case with
(&'static str, &'static str)
label set as follows:Considering there should be no dynamic allocation when accessing the metric with
(&'static str, &'static str)
label set, I suppose the performance would be the same as the custom type label set.But the benchmark turned out oppositely. (27ns vs 15ns on avg)
I'm not sure where the regression comes from. Is it as expected or did I miss something?
Thanks again for your help. 🙏
The text was updated successfully, but these errors were encountered: