From 4f69ba172e141a23ed7d9a27a65bbed7b2f91b0d Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 20 May 2024 10:08:03 -0500 Subject: [PATCH] add `math min` and `math max` to `bench` command (#12913) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This PR adds min and max to the bench command. ```nushell ❯ use std bench ❯ bench { dply -c 'parquet("./data.parquet") | group_by(year) | summarize(count = n(), sum = sum(geo_count)) | show()' | complete | null } --rounds 100 --verbose 100 / 100 ╭───────┬───────────────────╮ │ mean │ 71ms 358µs 850ns │ │ min │ 66ms 457µs 583ns │ │ max │ 120ms 338µs 167ns │ │ std │ 6ms 553µs 949ns │ │ times │ [list 100 items] │ ╰───────┴───────────────────╯ ``` # User-Facing Changes # Tests + Formatting # After Submitting --- crates/nu-std/std/mod.nu | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/nu-std/std/mod.nu b/crates/nu-std/std/mod.nu index 9d4387fa95..a20bdb4b78 100644 --- a/crates/nu-std/std/mod.nu +++ b/crates/nu-std/std/mod.nu @@ -148,6 +148,8 @@ export def bench [ let report = { mean: ($times | math avg | from ns) + min: ($times | math min | from ns) + max: ($times | math max | from ns) std: ($times | math stddev | from ns) times: ($times | each { from ns }) }