Benchmark Runner QoL Improvements#2672
Conversation
|
While trying to review I tried running the code but got an error: The file: fn void foo() @benchmark {
String s = string::format(mem, "Hello %s", "World");
free(s);
}There appears to have broken something with timing as I'm getting negative values for cpu-time. I applied my suggestion that I gave in the reviews below for the |
Sorry, as the author of initial implementation of benchmarking, I strongly object to this change. |
Can you provide info why? |
I respect your opinion about this, but a median is necessary for the reasons I detailed in the initial PR. The call to quicksort happens after all samples are already taken, if and only if the median report will be given. If you don't want to use a median, it's disabled by default. You can also turn it off permanently for your bench programmatically in a |
|
@data-man would you like to explain why? |
It's already 6 a.m. for me, I'll write tomorrow if possible. |
|
So, here are some thoughts:
I think most users would prefer Markdown. But ok, MD support can be added later.
The compiler does not need to be patched for this. I propose to add
|
|
Can we have a follow up to those concerns @NotsoanoNimus ? |
Perhaps "slightly" useless, but not entirely so. The fact of the matter is that a median metric from the runtime will objectively pardon its results from any significant outliers, which will skew an average value. I don't see why a metric which describes "at least 50% of runs hit this performance mark" isn't useful.
Totally agree with this. CSV was a quality-of-life, might-as-well addition to allow at least some automated parsing of runtime results if one so desires. Given that a Markdown table format is just as simple as combining commas a la CSV, I would have neither difficulty nor objection to adding this in as another option.
This isn't a bad idea, and I wouldn't have a problem changing this around some more to accommodate it. A struct-splat with I'd have to double-check that nothing is required before the runtime gets to an
For sure. Rather than create a new one or maintain my own, I thought it better to show some love to the current runtime without changing what it actually does too drastically (despite shifting inner its workings). Thanks for your honest feedback, @data-man. Ultimately, my heart won't be broken if this PR isn't merged. But before that's determined, let me run this TODO list back and make some changes for you to review further. |
|
Should this be a draft until you update? |
|
What's the current status? |
|
@lerno, I'd like to know your opinion about a progress bar. Is it really necessary? |
|
To me a progress bar is not necessary, esp given that it can interfere with measurements. I think the final list is the most important. |
The progress bar does not affect the sampling of each run, at least not explicitly (meaning there might be some other cache/performance aspect outside of the code). Regardless, I don't think I'm going to continue working on these improvements at this time anyhow: the further changes I've made have deviated so far from the original PR that it's not really sensible to push without opening another one sometime in the future. And I don't really have time to iterate on this right now.
|
|
Wait, wasn't this more than the progress bar? There's already one progress bar that we have. It's the one that is not necessary for me, although I can understand that seeing it might be nice. Just a spinner might be sufficient though. And didn't this one also have a CSV output? |
I work with
compile-benchmarkquite often - only fair I help with its upkeep. Slapped this together in a couple hours, because I really need more consistent results and a way to visualize them, and the benchmark runner is a bit of a rat's nest.Changes, in no particular order:
NanoDuration, so it can be used elsewhere as desired