Created
January 18, 2014 06:22
-
-
Save jots/8486945 to your computer and use it in GitHub Desktop.
ruby vs elixir
This file contains 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
$ 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