-
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
Ensure reported Time is walltime by removing spurious scaling by threads #1836
Conversation
JSON - yes, please. |
given the escalations we've had about this timing are focused on console reporter i think it's important to put it there.. hopefully noone is parsing it :D |
See #1834 for detailed description of why this is useful.
Two alternatives:
|
print it when needed: this is tricky with console because we print the header before we print the individual runs (unlike JSON). do the right thing: is it the right thing though? also we would change existing benchmarks significantly which would break a lot of existing developer expectations. |
Honestly this is why i never pushed on this issue after encountering it years ago :/
We already do something similar for tabular user counters it seems.
I understand that changing the actual underlying value would affect the results If anything, it makes the output consistent: "Time is the time passed on on the clock on your wall, |
hm true. i guess we could add a new header row if a run has a
i think i agree. and i think way back this is actually how it worked. i'm going to bet that someone parses this output. https://www.hyrumslaw.com/ but maybe if we bump to 1.9 this is ok? wdyt. |
I haven't checked the actual output, but as far as i can tell,
wink wink
Does the human-oriented display output count as public API? |
i'm so very tempted just to change the Time definition and release it as 1.9. i think i want at least 1 other person to agree explicitly that this is what we should do. i've also asked the discord for opinions. |
success (?) .. one other person on the discord agrees we should show the walltime as the Time and so this should be the new default. @LebedevRI do you concur making it 3? :) |
Oh wait, i have to retroactively change my previous comments. One thing i hadn't though about yet: so what happens with complexity reports and |
i'll change the default instead of just the reporting and we'll see. |
also "Process CPU time". i need to figure out if that should be scaled or not. i think probably not now? |
AFAICT we only scale (divide by thread count) wall/manual times, not CPU time, no? |
we scale CPU time (today) if it's "process cpu time". |
it's really hard to say if it's better or worse. it does now show that threads don't affect walltime for benchmarks that don't actually parallelise whereas before it showed it being reduced. ie in BM_CounterRates_Tabular, the benchmark multiplies two numbers. whether this is run using 1 thread or 1000, it should take the same amount of time. and now it does! |
Ah, so it looks like that CPU time rescaling was added in #763, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What could possibly go wrong?
dude, i'm so torn. the tests we have aren't real-world enough for me to draw any conclusions. i tried writing something that actually uses the threads (doing the same amount of work but only doing a smaller part if there's more threads) ** old timing (main) **
** new timing (branch) **
the point at which the real time starts dropping (2048 threads) in the new timing tells me something about how my system can perform for this task. the old timing tells me nothing that the CPU timing didn't already tell me. i think this convinces me that it's the right thing to do. @LebedevRI ? |
As i've consistently said previously, i don't see how the current behavior could be the expected one, |
(running some tests internally) |
we have a plan for how to roll this out. I will land it, release 1.9.0, send out some emails with warnings, and absorb complaints. but I'm convinced this is a bug we should fix. |
Yay, so we are doing the right thing then :) |
@dmah42, could you, please, clarify the relation between this PR and (unaccepted one at #946)? This is the only hunk that remains applicable atop of 1.9.0
Don't you think this division should be carried out? |
That line would affect the number of iterations for which a benchmark will be run. |
As [#1836](google/benchmark#1836) has landed into upstream, there is no need to keep [#946](google/benchmark#946) as a patch. d9d33ff20e1e7767759fc07ea97c1e661716f26a
As [#1836](google/benchmark#1836) has landed into upstream, there is no need to keep [#946](google/benchmark#946) as a patch. d9d33ff20e1e7767759fc07ea97c1e661716f26a
As [#1836](google/benchmark#1836) has landed into upstream, there is no need to keep [#946](google/benchmark#946) as a patch. d9d33ff20e1e7767759fc07ea97c1e661716f26a
As [#1836](google/benchmark#1836) has landed into upstream, there is no need to keep [#946](google/benchmark#946) as a patch. d9d33ff20e1e7767759fc07ea97c1e661716f26a
See #1834 for detailed description of why this is useful.