diff --git a/lib/bencher_adapter/src/adapters/c_sharp/dot_net.rs b/lib/bencher_adapter/src/adapters/c_sharp/dot_net.rs index 4e2090d0e..acea8b344 100644 --- a/lib/bencher_adapter/src/adapters/c_sharp/dot_net.rs +++ b/lib/bencher_adapter/src/adapters/c_sharp/dot_net.rs @@ -3,6 +3,7 @@ use bencher_json::{BenchmarkName, JsonAny, JsonNewMetric, project::report::JsonA use rust_decimal::Decimal; use serde::Deserialize; +use crate::results::adapter_results::DotNetMeasure; use crate::{ Adaptable, AdapterError, Settings, adapters::util::{Units, latency_as_nanos}, @@ -36,6 +37,7 @@ pub struct Benchmark { pub namespace: Option, pub method: BenchmarkName, pub statistics: Statistics, + pub memory: Option, } #[derive(Debug, Clone, Deserialize)] @@ -51,6 +53,16 @@ pub struct Statistics { pub interquartile_range: Decimal, } +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Memory { + pub gen0_collections: u32, + pub gen1_collections: u32, + pub gen2_collections: u32, + pub total_operations: u32, + pub bytes_allocated_per_operation: u32, +} + impl DotNet { fn convert(self, settings: Settings) -> Result, AdapterError> { let benchmarks = self.benchmarks.0; @@ -60,7 +72,9 @@ impl DotNet { namespace, method, statistics, + memory, } = benchmark; + let Statistics { mean, standard_deviation, @@ -84,24 +98,82 @@ impl DotNet { JsonAverage::Mean => (mean, standard_deviation), JsonAverage::Median => (median, interquartile_range), }; - let value = latency_as_nanos(average, units); + let latency_value = latency_as_nanos(average, units); let spread = latency_as_nanos(spread, units); - let json_metric = JsonNewMetric { - value, - lower_value: Some(value - spread), - upper_value: Some(value + spread), + let json_latency_metric = JsonNewMetric { + value: latency_value, + lower_value: Some(latency_value - spread), + upper_value: Some(latency_value + spread), }; - benchmark_metrics.push((benchmark_name, json_metric)); + let latency_measure = DotNetMeasure::Latency(json_latency_metric); + + let mut measures = vec![latency_measure]; + + if let Some(m) = memory { + let allocated_json = JsonNewMetric { + value: m.bytes_allocated_per_operation.into(), + lower_value: None, + upper_value: None, + }; + + let allocated_measure = DotNetMeasure::Allocated(allocated_json); + + measures.push(allocated_measure); + + let gen0_collects_json = JsonNewMetric { + value: m.gen0_collections.into(), + lower_value: None, + upper_value: None, + }; + + let gen0_measure = DotNetMeasure::Gen0Collects(gen0_collects_json); + + measures.push(gen0_measure); + + let gen1_collects_json = JsonNewMetric { + value: m.gen1_collections.into(), + lower_value: None, + upper_value: None, + }; + + let gen1_measure = DotNetMeasure::Gen1Collects(gen1_collects_json); + + measures.push(gen1_measure); + + let gen2_collects_json = JsonNewMetric { + value: m.gen2_collections.into(), + lower_value: None, + upper_value: None, + }; + + let gen2_measure = DotNetMeasure::Gen2Collects(gen2_collects_json); + + measures.push(gen2_measure); + + let total_operations_json = JsonNewMetric { + value: m.total_operations.into(), + lower_value: None, + upper_value: None, + }; + + let total_operations_measure = + DotNetMeasure::TotalOperations(total_operations_json); + + measures.push(total_operations_measure); + } + + benchmark_metrics.push((benchmark_name, measures)); } - Ok(AdapterResults::new_latency(benchmark_metrics)) + Ok(AdapterResults::new_dotnet(benchmark_metrics)) } } #[cfg(test)] pub(crate) mod test_c_sharp_dot_net { use bencher_json::project::report::JsonAverage; + use ordered_float::OrderedFloat; use pretty_assertions::assert_eq; use crate::{ @@ -242,6 +314,42 @@ pub(crate) mod test_c_sharp_dot_net { ); } + #[test] + fn adapter_c_sharp_dot_net_memory() { + let results = convert_c_sharp_dot_net("memory"); + assert_eq!(results.inner.len(), 2); + + let metrics = results + .get("BenchmarkDotNet.Samples.AllocEmptyList") + .unwrap(); + + let allocated = metrics.get("allocated").unwrap(); + assert_eq!(allocated.value, OrderedFloat::from(368)); + + let gen0collects = metrics.get("gen0-collects").unwrap(); + assert_eq!(gen0collects.value, OrderedFloat::from(184)); + + let gen1collects = metrics.get("gen1-collects").unwrap(); + assert_eq!(gen1collects.value, OrderedFloat::from(0)); + + let gen2collects = metrics.get("gen2-collects").unwrap(); + assert_eq!(gen2collects.value, OrderedFloat::from(0)); + + let total_operations = metrics.get("total-operations").unwrap(); + assert_eq!(total_operations.value, OrderedFloat::from(0x0080_0000)); + + let latency = metrics.get("latency").unwrap(); + assert_eq!(latency.value, OrderedFloat::from(77.494_494_120_279_95)); + assert_eq!( + latency.lower_value, + Some(OrderedFloat::from(76.318_534_543_028_99)) + ); + assert_eq!( + latency.upper_value, + Some(OrderedFloat::from(78.670_453_697_530_92)) + ); + } + #[test] fn adapter_c_sharp_dot_net_two_more_median() { let results = convert_c_sharp_dot_net_median("two_more"); diff --git a/lib/bencher_adapter/src/results/adapter_results.rs b/lib/bencher_adapter/src/results/adapter_results.rs index 00229146b..19fe97de4 100644 --- a/lib/bencher_adapter/src/results/adapter_results.rs +++ b/lib/bencher_adapter/src/results/adapter_results.rs @@ -32,6 +32,16 @@ pub enum AdapterMeasure { Throughput(JsonNewMetric), } +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum DotNetMeasure { + Latency(JsonNewMetric), + Gen0Collects(JsonNewMetric), + Gen1Collects(JsonNewMetric), + Gen2Collects(JsonNewMetric), + TotalOperations(JsonNewMetric), + Allocated(JsonNewMetric), +} + #[derive(Debug, Clone, PartialEq, Eq)] pub enum IaiMeasure { Instructions(JsonNewMetric), @@ -212,6 +222,44 @@ impl AdapterResults { Some(results_map.into()) } + pub fn new_dotnet(benchmark_metrics: Vec<(BenchmarkName, Vec)>) -> Option { + if benchmark_metrics.is_empty() { + return None; + } + + let mut results_map = HashMap::new(); + for (benchmark_name, measure) in benchmark_metrics { + let metrics_value = results_map + .entry(BenchmarkNameId::new_name(benchmark_name)) + .or_insert_with(AdapterMetrics::default); + for metric in measure { + let (resource_id, metric) = match metric { + DotNetMeasure::Latency(json_metric) => { + (built_in::default::Latency::name_id(), json_metric) + }, + DotNetMeasure::Allocated(json_metric) => { + (built_in::dotnet::Allocated::name_id(), json_metric) + }, + DotNetMeasure::Gen0Collects(json_metric) => { + (built_in::dotnet::Gen0Collects::name_id(), json_metric) + }, + DotNetMeasure::Gen1Collects(json_metric) => { + (built_in::dotnet::Gen1Collects::name_id(), json_metric) + }, + DotNetMeasure::Gen2Collects(json_metric) => { + (built_in::dotnet::Gen2Collects::name_id(), json_metric) + }, + DotNetMeasure::TotalOperations(json_metric) => { + (built_in::dotnet::TotalOperations::name_id(), json_metric) + }, + }; + metrics_value.inner.insert(resource_id, metric); + } + } + + Some(results_map.into()) + } + #[expect(clippy::too_many_lines)] pub fn new_gungraun( benchmark_metrics: Vec<(BenchmarkName, Vec)>, diff --git a/lib/bencher_adapter/tool_output/c_sharp/dot_net/memory.json b/lib/bencher_adapter/tool_output/c_sharp/dot_net/memory.json new file mode 100644 index 000000000..ea1db317f --- /dev/null +++ b/lib/bencher_adapter/tool_output/c_sharp/dot_net/memory.json @@ -0,0 +1,1180 @@ +{ + "Title": "BenchmarkDotNet.Samples.Memory-20260315-231008", + "HostEnvironmentInfo": { + "BenchmarkDotNetCaption": "BenchmarkDotNet", + "BenchmarkDotNetVersion": "0.15.8", + "OsVersion": "Windows 11 (10.0.26200.8037/25H2/2025Update/HudsonValley2)", + "ProcessorName": "AMD Ryzen 7 5800X", + "PhysicalProcessorCount": 1, + "PhysicalCoreCount": 8, + "LogicalCoreCount": 16, + "RuntimeVersion": ".NET 10.0.4 (10.0.4, 10.0.426.12010)", + "Architecture": "X64", + "HasAttachedDebugger": false, + "HasRyuJit": true, + "Configuration": "RELEASE", + "DotNetCliVersion": "10.0.200", + "ChronometerFrequency": { + "Hertz": 10000000 + }, + "HardwareTimerKind": "Unknown" + }, + "Benchmarks": [ + { + "DisplayInfo": "Memory.AllocEmptyList: ShortRun(IterationCount=3, LaunchCount=1, WarmupCount=3)", + "Namespace": "BenchmarkDotNet.Samples", + "Type": "Memory", + "Method": "AllocEmptyList", + "MethodTitle": "AllocEmptyList", + "Parameters": "", + "FullName": "BenchmarkDotNet.Samples.Memory.AllocEmptyList", + "HardwareIntrinsics": "AVX2+BMI1+BMI2+F16C+FMA+LZCNT+MOVBE,AVX,SSE3+SSSE3+SSE4.1+SSE4.2+POPCNT,X86Base+SSE+SSE2,AES+PCLMUL VectorSize=256", + "Statistics": { + "OriginalValues": [ + 76.35858058929443, + 77.41812467575073, + 78.70677709579468 + ], + "N": 3, + "Min": 76.35858058929443, + "LowerFence": 75.1272052526474, + "Q1": 76.88835263252258, + "Median": 77.41812467575073, + "Mean": 77.49449412027995, + "Q3": 78.0624508857727, + "UpperFence": 79.82359826564789, + "Max": 78.70677709579468, + "InterquartileRange": 1.174098253250122, + "LowerOutliers": [], + "UpperOutliers": [], + "AllOutliers": [], + "StandardError": 0.6789405784819621, + "Variance": 1.3828809273282634, + "StandardDeviation": 1.175959577250963, + "Skewness": 0.06466834262319426, + "Kurtosis": 0.6666666666666657, + "ConfidenceInterval": { + "N": 3, + "Mean": 77.49449412027995, + "StandardError": 0.6789405784819621, + "Level": 12, + "Margin": 21.453880306796293, + "Lower": 56.04061381348366, + "Upper": 98.94837442707625 + }, + "Percentiles": { + "P0": 76.35858058929443, + "P25": 76.88835263252258, + "P50": 77.41812467575073, + "P67": 77.85626649856567, + "P80": 78.1913161277771, + "P85": 78.3201813697815, + "P90": 78.44904661178589, + "P95": 78.57791185379028, + "P100": 78.70677709579468 + } + }, + "Memory": { + "Gen0Collections": 184, + "Gen1Collections": 0, + "Gen2Collections": 0, + "TotalOperations": 8388608, + "BytesAllocatedPerOperation": 368 + }, + "Measurements": [ + { + "IterationMode": "Overhead", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 1, + "Nanoseconds": 162600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 1, + "Nanoseconds": 230200 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16, + "Nanoseconds": 158500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16, + "Nanoseconds": 159100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16, + "Nanoseconds": 13600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 32, + "Nanoseconds": 15200 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 64, + "Nanoseconds": 22500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 128, + "Nanoseconds": 38100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 256, + "Nanoseconds": 138300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 512, + "Nanoseconds": 187600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 7, + "Operations": 1024, + "Nanoseconds": 280000 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 8, + "Operations": 2048, + "Nanoseconds": 531600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 9, + "Operations": 4096, + "Nanoseconds": 1079600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 10, + "Operations": 8192, + "Nanoseconds": 2286800 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 11, + "Operations": 16384, + "Nanoseconds": 4058600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 12, + "Operations": 32768, + "Nanoseconds": 9082500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 13, + "Operations": 65536, + "Nanoseconds": 15803200 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 14, + "Operations": 131072, + "Nanoseconds": 25633400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 15, + "Operations": 262144, + "Nanoseconds": 46894000 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 16, + "Operations": 524288, + "Nanoseconds": 65023700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 17, + "Operations": 1048576, + "Nanoseconds": 84213700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 18, + "Operations": 2097152, + "Nanoseconds": 175612400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 19, + "Operations": 4194304, + "Nanoseconds": 329210900 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 20, + "Operations": 8388608, + "Nanoseconds": 653623400 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 8388608, + "Nanoseconds": 13431200 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 8388608, + "Nanoseconds": 13529700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 8388608, + "Nanoseconds": 13704800 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 8388608, + "Nanoseconds": 13377700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 8388608, + "Nanoseconds": 13576500 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 8388608, + "Nanoseconds": 13574700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 8388608, + "Nanoseconds": 13491700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 8388608, + "Nanoseconds": 13317900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 8388608, + "Nanoseconds": 13466300 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 8388608, + "Nanoseconds": 13508100 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 8388608, + "Nanoseconds": 13427400 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 8388608, + "Nanoseconds": 13489600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 7, + "Operations": 8388608, + "Nanoseconds": 13413900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 8, + "Operations": 8388608, + "Nanoseconds": 13567900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 9, + "Operations": 8388608, + "Nanoseconds": 13408600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 10, + "Operations": 8388608, + "Nanoseconds": 13185400 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 11, + "Operations": 8388608, + "Nanoseconds": 13556700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 12, + "Operations": 8388608, + "Nanoseconds": 13394600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 13, + "Operations": 8388608, + "Nanoseconds": 13362500 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 14, + "Operations": 8388608, + "Nanoseconds": 13514200 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 15, + "Operations": 8388608, + "Nanoseconds": 14330100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 8388608, + "Nanoseconds": 661718400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 8388608, + "Nanoseconds": 679874500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 8388608, + "Nanoseconds": 658565800 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 8388608, + "Nanoseconds": 654008500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 8388608, + "Nanoseconds": 662896600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 8388608, + "Nanoseconds": 673706600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 8388608, + "Nanoseconds": 640542200 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 8388608, + "Nanoseconds": 649430300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 8388608, + "Nanoseconds": 660240300 + } + ], + "Metrics": [ + { + "Value": 0.02193450927734375, + "Descriptor": { + "Id": "Gen0Collects", + "DisplayName": "Gen0", + "Legend": "GC Generation 0 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 0 + } + }, + { + "Value": 0, + "Descriptor": { + "Id": "Gen1Collects", + "DisplayName": "Gen1", + "Legend": "GC Generation 1 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 1 + } + }, + { + "Value": 0, + "Descriptor": { + "Id": "Gen2Collects", + "DisplayName": "Gen2", + "Legend": "GC Generation 2 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 2 + } + }, + { + "Value": 368, + "Descriptor": { + "Id": "Allocated Memory", + "DisplayName": "Allocated", + "Legend": "Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat": "0.##", + "UnitType": 2, + "Unit": "B", + "TheGreaterTheBetter": false, + "PriorityInCategory": 3 + } + } + ] + }, + { + "DisplayInfo": "Memory.AllocExactList: ShortRun(IterationCount=3, LaunchCount=1, WarmupCount=3)", + "Namespace": "BenchmarkDotNet.Samples", + "Type": "Memory", + "Method": "AllocExactList", + "MethodTitle": "AllocExactList", + "Parameters": "", + "FullName": "BenchmarkDotNet.Samples.Memory.AllocExactList", + "HardwareIntrinsics": "AVX2+BMI1+BMI2+F16C+FMA+LZCNT+MOVBE,AVX,SSE3+SSSE3+SSE4.1+SSE4.2+POPCNT,X86Base+SSE+SSE2,AES+PCLMUL VectorSize=256", + "Statistics": { + "OriginalValues": [ + 54.01603579521179, + 55.24192452430725, + 54.68738079071045 + ], + "N": 3, + "Min": 54.01603579521179, + "LowerFence": 53.432291746139526, + "Q1": 54.35170829296112, + "Median": 54.68738079071045, + "Mean": 54.648447036743164, + "Q3": 54.96465265750885, + "UpperFence": 55.884069204330444, + "Max": 55.24192452430725, + "InterquartileRange": 0.6129443645477295, + "LowerOutliers": [], + "UpperOutliers": [], + "AllOutliers": [], + "StandardError": 0.35441861874028235, + "Variance": 0.3768376719293087, + "StandardDeviation": 0.613871054806552, + "Skewness": -0.0631682205027393, + "Kurtosis": 0.6666666666666666, + "ConfidenceInterval": { + "N": 3, + "Mean": 54.648447036743164, + "StandardError": 0.35441861874028235, + "Level": 12, + "Margin": 11.19929323116176, + "Lower": 43.4491538055814, + "Upper": 65.84774026790492 + }, + "Percentiles": { + "P0": 54.01603579521179, + "P25": 54.35170829296112, + "P50": 54.68738079071045, + "P67": 54.87592566013336, + "P80": 55.02010703086853, + "P85": 55.07556140422821, + "P90": 55.13101577758789, + "P95": 55.18647015094757, + "P100": 55.24192452430725 + } + }, + "Memory": { + "Gen0Collections": 184, + "Gen1Collections": 0, + "Gen2Collections": 0, + "TotalOperations": 16777216, + "BytesAllocatedPerOperation": 184 + }, + "Measurements": [ + { + "IterationMode": "Overhead", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 1, + "Nanoseconds": 129700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 1, + "Nanoseconds": 210700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16, + "Nanoseconds": 162600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Jitting", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16, + "Nanoseconds": 189300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16, + "Nanoseconds": 5700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 32, + "Nanoseconds": 10300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 64, + "Nanoseconds": 16100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 128, + "Nanoseconds": 30300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 256, + "Nanoseconds": 111400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 512, + "Nanoseconds": 184800 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 7, + "Operations": 1024, + "Nanoseconds": 292100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 8, + "Operations": 2048, + "Nanoseconds": 419600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 9, + "Operations": 4096, + "Nanoseconds": 794700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 10, + "Operations": 8192, + "Nanoseconds": 1607300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 11, + "Operations": 16384, + "Nanoseconds": 3031400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 12, + "Operations": 32768, + "Nanoseconds": 5804500 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 13, + "Operations": 65536, + "Nanoseconds": 11682800 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 14, + "Operations": 131072, + "Nanoseconds": 20664300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 15, + "Operations": 262144, + "Nanoseconds": 37717400 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 16, + "Operations": 524288, + "Nanoseconds": 41705800 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 17, + "Operations": 1048576, + "Nanoseconds": 61728900 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 18, + "Operations": 2097152, + "Nanoseconds": 118595100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 19, + "Operations": 4194304, + "Nanoseconds": 229982100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 20, + "Operations": 8388608, + "Nanoseconds": 465962300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Pilot", + "LaunchIndex": 1, + "IterationIndex": 21, + "Operations": 16777216, + "Nanoseconds": 933330900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16777216, + "Nanoseconds": 26560400 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16777216, + "Nanoseconds": 27009300 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 16777216, + "Nanoseconds": 26876800 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 16777216, + "Nanoseconds": 26833500 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 16777216, + "Nanoseconds": 26853600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 16777216, + "Nanoseconds": 28488500 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 7, + "Operations": 16777216, + "Nanoseconds": 26845600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16777216, + "Nanoseconds": 30845900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16777216, + "Nanoseconds": 26800800 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 16777216, + "Nanoseconds": 26944800 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 4, + "Operations": 16777216, + "Nanoseconds": 26821100 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 5, + "Operations": 16777216, + "Nanoseconds": 26835100 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 6, + "Operations": 16777216, + "Nanoseconds": 26931000 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 7, + "Operations": 16777216, + "Nanoseconds": 26789900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 8, + "Operations": 16777216, + "Nanoseconds": 26706700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 9, + "Operations": 16777216, + "Nanoseconds": 26852200 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 10, + "Operations": 16777216, + "Nanoseconds": 26961800 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 11, + "Operations": 16777216, + "Nanoseconds": 27270600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 12, + "Operations": 16777216, + "Nanoseconds": 19582100 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 13, + "Operations": 16777216, + "Nanoseconds": 19446900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 14, + "Operations": 16777216, + "Nanoseconds": 19271900 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 15, + "Operations": 16777216, + "Nanoseconds": 19392600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 16, + "Operations": 16777216, + "Nanoseconds": 19179700 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 17, + "Operations": 16777216, + "Nanoseconds": 19383300 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 18, + "Operations": 16777216, + "Nanoseconds": 19234000 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 19, + "Operations": 16777216, + "Nanoseconds": 19603600 + }, + { + "IterationMode": "Overhead", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 20, + "Operations": 16777216, + "Nanoseconds": 19410100 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16777216, + "Nanoseconds": 931608600 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16777216, + "Nanoseconds": 925956000 + }, + { + "IterationMode": "Workload", + "IterationStage": "Warmup", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 16777216, + "Nanoseconds": 939566900 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16777216, + "Nanoseconds": 932987000 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16777216, + "Nanoseconds": 953554000 + }, + { + "IterationMode": "Workload", + "IterationStage": "Actual", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 16777216, + "Nanoseconds": 944250300 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 1, + "Operations": 16777216, + "Nanoseconds": 906238700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 2, + "Operations": 16777216, + "Nanoseconds": 926805700 + }, + { + "IterationMode": "Workload", + "IterationStage": "Result", + "LaunchIndex": 1, + "IterationIndex": 3, + "Operations": 16777216, + "Nanoseconds": 917502000 + } + ], + "Metrics": [ + { + "Value": 0.010967254638671875, + "Descriptor": { + "Id": "Gen0Collects", + "DisplayName": "Gen0", + "Legend": "GC Generation 0 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 0 + } + }, + { + "Value": 0, + "Descriptor": { + "Id": "Gen1Collects", + "DisplayName": "Gen1", + "Legend": "GC Generation 1 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 1 + } + }, + { + "Value": 0, + "Descriptor": { + "Id": "Gen2Collects", + "DisplayName": "Gen2", + "Legend": "GC Generation 2 collects per 1000 operations", + "NumberFormat": "#0.0000", + "UnitType": 0, + "Unit": "Count", + "TheGreaterTheBetter": false, + "PriorityInCategory": 2 + } + }, + { + "Value": 184, + "Descriptor": { + "Id": "Allocated Memory", + "DisplayName": "Allocated", + "Legend": "Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat": "0.##", + "UnitType": 2, + "Unit": "B", + "TheGreaterTheBetter": false, + "PriorityInCategory": 3 + } + } + ] + } + ] +} diff --git a/lib/bencher_json/src/project/measure/built_in.rs b/lib/bencher_json/src/project/measure/built_in.rs index 1a397bcef..87ba9e3ac 100644 --- a/lib/bencher_json/src/project/measure/built_in.rs +++ b/lib/bencher_json/src/project/measure/built_in.rs @@ -81,6 +81,21 @@ pub mod json { create_measure!(FileSize, "File Size", "file-size", BYTES); } +pub mod dotnet { + use bencher_valid::BYTES; + + create_measure!(Allocated, "Allocated", "allocated", BYTES); + create_measure!(Gen0Collects, "Gen0 Collects", "gen0-collects", "collects"); + create_measure!(Gen1Collects, "Gen1 Collects", "gen1-collects", "collects"); + create_measure!(Gen2Collects, "Gen2 Collects", "gen2-collects", "collects"); + create_measure!( + TotalOperations, + "Total Operations", + "total-operations", + "operations" + ); +} + pub mod iai { create_measure!(Instructions, "Instructions", "instructions", "instructions"); create_measure!(L1Accesses, "L1 Accesses", "l1-accesses", "accesses");