From b0566cca291881abceafdabedf1aa7993a27a5ce Mon Sep 17 00:00:00 2001 From: Jake Bolton Date: Fri, 22 Dec 2023 14:06:15 -0600 Subject: [PATCH] benchmark: compare foreach enmerations --- Pwsh/Benchmark/Linq.EnumerableRange.benchmark.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Pwsh/Benchmark/Linq.EnumerableRange.benchmark.ps1 b/Pwsh/Benchmark/Linq.EnumerableRange.benchmark.ps1 index 072d92e..ea33b70 100644 --- a/Pwsh/Benchmark/Linq.EnumerableRange.benchmark.ps1 +++ b/Pwsh/Benchmark/Linq.EnumerableRange.benchmark.ps1 @@ -1,8 +1,14 @@ @' Outputs: -# grouped - +# sort: Time + +Technique Time RelativeSpeed GroupName Throughput +--------- ---- ------------- --------- ---------- +Nums = [EnumerableRange]::(0, 4mb ) 00:00:00.0124675 1.00 160.42 +[EnumerableRange]::(0, 4mb ) | %{ $_ } 00:00:00.0846974 6.79 23.61 +Nums = 0..4mb 00:00:00.9147725 73.37 2.19 +Nums = 0..4mb | %{ $_ } 00:00:32.7884668 2629.92 0.06 '@ h1 (Join-String -f 'File: {0}' -in $PSCommandPath)