Beatwc

Goofing around to see if we can beatwc in Elixir

View the Project on GitHub bbense/beatwc

Beating System.cmd("wc",["-l", file]) with native Elixir code

Know the Enemy

 def wc_l(path) do
    {result, 0} = System.cmd("wc",["-l", path])
    result
    |> String.split
    |> List.first
    |> String.to_integer
  end

Naive File.Stream!

First pass at slurp with :binary functions

File slurping with only NIF functions from :binary

NIF functions from :binary with file chunking

NIF functions from :binary with file chunking and parallel task execution