Last active
May 10, 2016 11:43
-
-
Save johannesboyne/00151191e4da122fd624ba4bfad19981 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# $ iex -S mix --> 22 MB | |
KV.Registry.start_link(:kvname) | |
1..100_000 | |
|> Enum.map(&(KV.Registry.create(:kvname, "list#{&1}"))) | |
|> Enum.map(&(KV.Bucket.put(&1, "milk", :random.uniform))) | |
# --> 374 MB | |
1..100_000 | |
|> Stream.map(&( KV.Registry.lookup(:kvname, "list#{&1}") )) | |
|> Stream.map(fn {:ok, bucket} -> KV.Bucket.get(bucket, "milk") end) | |
|> Enum.take_random(5) | |
# --> (peak) 381 MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment