Adventures in F# Performance – Benchmarking the F# Core Library
jackmott.github.io
jackmott.github.io
let filter f (array: _[]) =
checkNonNull "array" array
let res = List<_>() // ResizeArray
for i = 0 to array.Length - 1 do
let x = array.[i]
if f x then res.Add(x)
res.ToArray()