diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Equality.fs b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Equality.fs index 1d2fc84bc68..42135e90a72 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Equality.fs +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Equality.fs @@ -9,52 +9,56 @@ type SomeStruct = type EqualityBenchmarks() = + let array = Array.init 1000 id + let list = List.init 1000 id + let seq = Seq.init 1000 id + [] member _.ArrayCountBy() = - Array.init 1000 id + array |> Array.countBy (fun n -> SomeStruct(n % 7)) [] member _.ArrayGroupBy() = - Array.init 1000 id + array |> Array.groupBy (fun n -> SomeStruct(n % 7)) [] member _.ArrayDistinct() = - Array.init 1000 id + array |> Array.map (fun n -> SomeStruct(n % 7)) |> Array.distinct [] member _.ArrayDistinctBy() = - Array.init 1000 id + array |> Array.distinctBy (fun n -> SomeStruct(n % 7)) [] member _.ArrayExcept() = - Array.init 1000 id + array |> Array.map SomeStruct |> Array.except ([| SomeStruct 42 |]) [] member _.ListCountBy() = - List.init 1000 id + list |> List.countBy (fun n -> SomeStruct(n % 7)) [] member _.ListGroupBy() = - List.init 1000 id + list |> List.groupBy (fun n -> SomeStruct(n % 7)) [] member _.ListDistinct() = - List.init 1000 id + list |> List.map (fun n -> SomeStruct(n % 7)) |> List.distinct [] member _.ListDistinctBy() = - List.init 1000 id + list |> List.distinctBy (fun n -> SomeStruct(n % 7)) [] @@ -65,32 +69,32 @@ type EqualityBenchmarks() = [] member _.SeqCountBy() = - Seq.init 1000 id + seq |> Seq.countBy (fun n -> SomeStruct(n % 7)) |> Seq.last [] member _.SeqGroupBy() = - Seq.init 1000 id + seq |> Seq.groupBy (fun n -> SomeStruct(n % 7)) |> Seq.last [] member _.SeqDistinct() = - Seq.init 1000 id + seq |> Seq.map (fun n -> SomeStruct(n % 7)) |> Seq.distinct |> Seq.last [] member _.SeqDistinctBy() = - Seq.init 1000 id + seq |> Seq.distinctBy (fun n -> SomeStruct(n % 7)) |> Seq.last [] member _.SeqExcept() = - Seq.init 1000 id + seq |> Seq.map SomeStruct |> Seq.except ([| SomeStruct 42 |]) |> Seq.last