Skip to content

Instantly share code, notes, and snippets.

@jots
Created January 18, 2014 06:22
Show Gist options
  • Save jots/8486945 to your computer and use it in GitHub Desktop.
Save jots/8486945 to your computer and use it in GitHub Desktop.
ruby vs elixir
$ cat b.rb
array = (1..5_000_000).map { rand }
$ time ruby b.rb
real 0m0.911s
user 0m0.822s
sys 0m0.088s
$ cat b.ex
array = Enum.map (1..5_000_000), fn(_) -> :random.uniform end
$ time elixir b.ex
b.ex:1: variable array is unused
real 0m2.990s
user 0m2.567s
sys 0m0.469s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment