andrewrk / poop

Performance Optimizer Observation Platform
MIT License
788 stars 50 forks source link

Use some max number of sigfigs #28

Closed candrewlee14 closed 1 year ago

candrewlee14 commented 1 year ago

Keeping some max number of sigfigs would be useful to keep columns a consistent comptime-known width. This would make it easier to align columns centrally while maintaining their alignment across benchmarks. Maybe this requires something like scientific notation. Relevant for #24.

The other reason it'd be useful is in some cases I get max RSS = "2M" for two different cases, but one is reported to be like 10% lower. The rounding is hiding important info. It'd be nice to see "2.14M" instead.

I'm not sure exactly how many sigfigs would be best and they might differ for each measurement, but I think 3 or 4 might be a good start.

dweiller commented 1 year ago

If we want comptime-known widths we will need something like scientific notation unless the columns are wide enough to hold the maximum possible printable width of a measurement (I have gotten underflows on some usages due to current widths being too low). I would think that the number of significant figures should be based on the variance of a measurement, however this could cause issues if variance is low with big measurements, so there might still need to be a hard limit, even if it means the printed result indicates a lower level of confidence in the result than reality.