Skip to content

Instantly share code, notes, and snippets.

@manofstick
Last active July 25, 2018 07:16
Show Gist options
  • Save manofstick/f285aa7b16025aabd4f60a4b8413ab81 to your computer and use it in GitHub Desktop.
Save manofstick/f285aa7b16025aabd4f60a4b8413ab81 to your computer and use it in GitHub Desktop.
// from https://ayende.com/blog/164865/what-about-f-collections
open System
open System.Diagnostics
let ayende iterations =
let sp = Stopwatch.StartNew ()
let rnd = Random 32
let mutable dic = Map.empty
for i = 0 to iterations-1 do
for item in System.Linq.Enumerable.Range (rnd.Next (0, i), max (i * 2) 16) do
dic <- dic |> Map.add item null
printfn "%s,%d,%d" (if Environment.Is64BitProcess then "64-bit" else "32-bit") iterations sp.ElapsedMilliseconds
for i in [250..250..1500] do
ayende i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment