-
Notifications
You must be signed in to change notification settings - Fork 27
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
Scale built in Measure units #311
Comments
This will be pretty trivial to implement for the built in Measure units. With that said, I think that Measures should be able to supply a For security and approachability reasons, I think that AssemblyScript would be a good choice here, with the |
This should also work in the benchmark results table, so the solution here should be persisted across all views. That is, this should not just be for the Perf Plot UI. |
I want to suggest to not couple this to the metric itself. In fact, even the unit itself seems to be unnecessarily coupled to the metric? We have some benchmarks that measure throughout. For those particular ones, the metric is bits / s in the MBit range. But for other benchmarks, the same metric could mean something else in a different range, right? So perhaps this needs to be separate from the metrics and instead associated with a benchmark to make the plots look nice. |
I think what you are advocating for is the way things work now.
So the Measure here would be When this issue is completed, Bencher would have a way to scale Does that make sense? Let me know if I'm missing anything for your use case though. |
Currently, a unit is associated with a measure, like bits / s with What if I have multiple benchmarks in my project that all have a form of throughput but one of them is in Would you expect to define more specific throughputs then? It feels odd that a measure is something you define as a separate entity to be reused across benchmarks, even though it might not apply to all benchmarks in a project. Adding scaling to this complicates this further: What if two benchmarks in the same project use bits / s but one is in the GB/s range and the other in KB/s. Do I need to make two different measures for this too? |
Correct!
I would recommend creating two Measures:
Can you help me understand why this feels odd? Bencher needs to be able to support benchmarks that have 1 to many different measurements. We can't assume that all of these measurements will always be used by all benchmarks though. For example:
The current thought is that you would use one Measure for both of these cases using the lowest, indivisible units as the "base". For your example this would be So when viewing the benchmarks that are in the |
Okay, this makes more sense! I think I got confused because the throughput metrics was pre-created and said something generic like "operations / s" so I thought this was meant to be used for all kinds of throughputs. Maybe that could be made more specific so it is clear that creating new measures is something one is expected to do? |
Ah, yeah. The built-in Throughput is there because some of the general purpose benchmarking harnesses report throughput. The units they all use for the numerator is likewise rather generic. I just went with
Definitely! The only nuance is that it is only expected when creating a custom benchmarking harness. |
nvm, just read the thing about custom harnesses. Wouldn't it always make sense for users to create a custom measure? Perhaps the measure for built-in adapters need to be configurable via an env var so users can set it? |
It would not always make sense.
This is up to the benchmarking harness itself to support. I have yet to see this in the wild though. |
Completed: https://bencher.dev/docs/reference/changelog/#v0431 The way this is implemented is very simple. Just the name of the Measure units is checked. If name of the units is one of the following in the first level of the list, then there is built-in "smart" auto-scaling to all of the units in the second level of the list:
For all other Measure units, auto-scaling simply uses exponential notation with the existing units name:
For Perf Plots and Perf Images, the auto-scaling is based on the minimum value for ALL visible elements. For Reports and PR comments, the benchmark results table auto-scaling is based on the minimum value for EACH Measure. That is, the auto-scaling is independent for each Measure. For the Alerts table, the auto-scaling is independent for each row. For example, if there is just a single Metric with a value of Note, that since this is based solely on the name of the units, a custom Measure can still benefit from "smart" auto-scaling units if they named their units |
@epompeii This is great improvement. Since all of my benchmarks were reading seconds, now I can understand them much better. One detail. Would it be possible to apply the same logic for hover message? Here is an example: |
@mrazauskas I'm glad that the auto-scaling is helpful. It is definitely possible to use the auto-scaled values in the hover over. I opted to keep the raw value for the time being to see what users preferred. I'll add a +1 to the scaled tally. 😃 |
is there also auto-scaling for throughput? |
@thomaseizinger there is, however it is currently handled by the catch-all. For example, Because throughput is operations divided by time, I would have to actually scale down the time units in order to "smart" auto-scale. So the example above would scale to |
In our case, throughput is effectively in the hundreds of megabits per second. It would be nice to see that in the correct scals instead of 1e6 x bits / sec (although that is pretty good already too). |
Thank you for the feedback, @thomaseizinger. I have added a tracking issue: #544 |
Currently, the built in units use the most exact possible units. For example Latency uses nanoseconds.
This can lead to some rather ridiculously large Metrics (ex
13,000,000,000,000
nanoseconds).In the Perf Plots:
The text was updated successfully, but these errors were encountered: