Skip to content
Permalink
Browse files

memory test

  • Loading branch information...
alvises committed Apr 3, 2019
1 parent 36bc216 commit cb6953847f49345d86ccf48905dfe777624eff45
Showing with 20 additions and 0 deletions.
  1. +20 −0 memory_test.exs
@@ -0,0 +1,20 @@
:observer.start
:timer.sleep 5_000
IO.puts("starting...")

chunk_size = 2_000

"numbers_small.txt"
|> File.stream!([],chunk_size)
|> HTTPStream.lines(:next_lines)

|> Stream.map(fn line ->
case Integer.parse(line) do
{num, _} -> num
:error -> 0
end
end)
|> Enum.sum()
|> IO.puts()

:timer.sleep 20_000

0 comments on commit cb69538

Please sign in to comment.
You can’t perform that action at this time.