Last active
August 29, 2015 14:05
-
-
Save davidgrenier/39b265dc2b1a8d68ef13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r @"C:\Projects\Streams\src\Streams.Core\bin\Release\Streams.Core.dll" | |
open Nessos.Streams.Core | |
let data = | |
[| | |
let rnd = System.Random().NextDouble >> (*) 1e3 | |
for x in -10.0 .. 10.0 do | |
yield System.DateTime.Now.AddDays (rnd()) | |
|] | |
#time;; | |
for x = 0 to 1000000 do | |
data | |
|> Stream.ofArray | |
|> Stream.sortBy (fun x -> System.DateTime.MaxValue - x) | |
|> Stream.tryFind (fun _ -> true) | |
|> ignore;; | |
for x = 0 to 1000000 do | |
data | |
|> Array.sortBy (fun x -> System.DateTime.MaxValue - x) | |
|> Array.tryFind (fun _ -> true) | |
|> ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment