Add benchmark machine#11198
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This reverts commit d4ee982.
| pub fn run(&self) -> Result<()> { | ||
| info!("Running machine benchmarks..."); | ||
| let tmp_dir = tempdir()?; | ||
| let info = gather_hwbench(Some(tmp_dir.path())); |
There was a problem hiding this comment.
It'd probably be better to modify sc-sysinfo to expose the benchmark_* functions separately and call them one by one here instead of relying the gather_hwbench.
The gather_hwbench is deliberately simple (only takes a path as an argument) and ignores error (if the disk benches fail it'll set their results to None and only print out a warning in the logs) since it's meant to be run at startup to gather the data for telemetry.
Here however it'd be good to 1) have direct access to the errors (which the benchmark_* functions do return), and 2) be able to configure the benchmarks to be able to override the limit of how long they can run and for how many iterations since this subcommand doesn't have the same timing constraints as the telemetry (so we can just add an extra argument to the benchmark_* functions which would allow you to override that).
There was a problem hiding this comment.
Yea getting some more configurations in there would be good.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
|
In the spirit of pits of success, maybe add an extra line in the output if they're running in debug mode warning them that they should only trust the results if they are running in release mode? |
| .map(|s| s as u64) | ||
| } | ||
|
|
||
| pub fn benchmark_sr25519_verify(limit: ExecutionLimit) -> f64 { |
There was a problem hiding this comment.
nit: missing doc on public function. Does it need to be public?
There was a problem hiding this comment.
Will add 😄
Currently it needs to be public since I call these functions directly. IMHO it would be better to have a gather function which calls all of them and returns a struct,
but thats probably next.
There was a problem hiding this comment.
IMHO it would be better to have a
gatherfunction which calls all of them and returns a struct,
Hmm... although the downside of that is that you won't be able to configure them separately (set a different ExecutionLimit for each benchmark), unless you add another struct which will have multiple ExecutionLimits in it, but then if you're going to do that you might as well have them as a separate functions I guess?
(And it might make sense to set different limits on each benchmark because e.g. the disk benchmarks are going to require more time than the memory benchmark to make sure their result isn't noisy, if you absolutely want to minimize their error.)
|
bot merge |
* Move new_rng to shared code Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add bechmark machine command Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add --no-hardware-benchmarks Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Lockfile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Do not create components if not needed Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "Add --no-hardware-benchmarks" This reverts commit d4ee982. * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update Cargo deps Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Switch benchmarks to return f64 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Review fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Hide command until completed Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use concrete rand implementation Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Put clobber into a function Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add comment Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update cargo to match polkadot Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove doc that does not format in the console Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Limit benchmark by time Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add ExecutionLimit and make function infallible Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * CI Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add doc Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Move new_rng to shared code Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add bechmark machine command Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add --no-hardware-benchmarks Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Lockfile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Do not create components if not needed Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "Add --no-hardware-benchmarks" This reverts commit d4ee982. * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update Cargo deps Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move sr255119::verify bench to sc-sysinfo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Switch benchmarks to return f64 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Review fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Hide command until completed Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use concrete rand implementation Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Put clobber into a function Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add comment Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update cargo to match polkadot Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove doc that does not format in the console Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Limit benchmark by time Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add ExecutionLimit and make function infallible Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * CI Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add doc Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
👉 Please put feedback about this command either in here or ping me on matrix
@oliver.tale-yazdi:matrix.parity.io.First version of a
benchmark machinecommand using thesc-sysinfocrate (:pray: @koute).@shawntabrizi wanted to have a MVP version handy.
Changes:
benchmark machinecommandnew_rngtoshared--no-hardware-benchmarkswhere applicableOutput:
Next steps:
productionsc-sysinfo(eg. total time, reps, input len)Polkadot companion: paritytech/polkadot#5326
Cumulus companion: paritytech/cumulus#1172