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

bug: cpu work in ops benchmark of core is optimized out #5075

Open
1 task done
NKID00 opened this issue Aug 30, 2024 · 0 comments
Open
1 task done

bug: cpu work in ops benchmark of core is optimized out #5075

NKID00 opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NKID00
Copy link
Contributor

NKID00 commented Aug 30, 2024

Describe the bug

The following code in bench_read_parallel is optimized out before benchmark:

let mut d = 0;
// mock same little cpu work
for c in offset..offset + 100u64 {
d += c & (0x1f1f1f1f + c % 256);
}
let _ = d;

Steps to Reproduce

The entire loop is optimized out in emitted llvm ir displayed using cargo-show-asm:

cargo asm -p opendal --bench ops --features tests --release --llvm ops::read::bench_read_parallel 12

Expected Behavior

This piece of code should not be optimized out.

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@NKID00 NKID00 added the bug Something isn't working label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant