On a dummy 100MB text file, the use of a 8kB buffer seems ~25x faster than the default line per line behavior on my machine.
File.stream!("big.txt", [:read], 8192) |> Stream.map(&String.trim/1) |> Enum.to_list()
On a dummy 100MB text file, the use of a 8kB buffer seems ~25x faster than the default line per line behavior on my machine.
File.stream!("big.txt", [:read], 8192) |> Stream.map(&String.trim/1) |> Enum.to_list()