-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
How to post my issue to https://groups.google.com/d/forum/benchmark-discuss #1798
Comments
depending on what you're doing the compiler just might be that good. https://godbolt.org/z/rT6E3bf9b shows that the compiler reduces the code quite a bit. |
@dmah42 Question 2: which assembly lines are for the MyClass ctor? These? |
I want to move similar questions https://groups.google.com/d/forum/benchmark-discuss, but I can't post any question there. |
I can't identify the assembly without seeing what your class does. but godbolt does a good job of mapping the code to the assembly so you should be able to see it there. |
I meant by using your MyClass impl, where is the assembly code? |
ah, line 30 ( mov %rax,0x8(%rsp) ) but there's also a couple of lines moving the value to the stack: you can see this in the tool with the color coding. |
I joined the group but I can't post my question there. Please guide.
I have a class MyClass and I want to measure its ctor performance like this:
static void BM_decimal_ctor_dbl(benchmark::State& state)
{
for (auto _ : state)
{
const MyClass d{123.67};
benchmark::DoNotOptimize(d);
}
}
2024-06-07T13:50:06+08:00
Running ./AS7_DEC/decimalBM
Run on (12 X 2194.84 MHz CPU s)
CPU Caches:
L1 Data 48 KiB (x12)
L1 Instruction 32 KiB (x12)
L2 Unified 1280 KiB (x12)
L3 Unified 49152 KiB (x2)
Load Average: 0.10, 0.17, 0.18
Benchmark Time CPU Iterations
BM_decimal_ctor_dbl 0.364 ns 0.364 ns 1937088812
I doubted my class performance too good. Is my benchmark code correct?
The text was updated successfully, but these errors were encountered: