Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #time
- [<Struct>]
- type ResultStruct<'T, 'TError> =
- | OkS of ok : 'T
- | ErrorS of error : 'TError
- type ResultClass<'T, 'TError> =
- | OkC of ok : 'T
- | ErrorC of error : 'TError
- let data = [|1..100000000|]
- data |> Seq.map(fun x -> OkS x) |> Seq.map id |> Seq.length // Real: 00:00:08.081, CPU: 00:00:08.046, GC gen0: 0, gen1: 0, gen2: 0
- data |> Seq.map(fun x -> OkC x) |> Seq.map id |> Seq.length // Real: 00:00:06.668, CPU: 00:00:06.671, GC gen0: 381, gen1: 0, gen2: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement