Created
May 17, 2017 07:59
-
-
Save leifg/fca34d7140d9f0818595318248ab5373 to your computer and use it in GitHub Desktop.
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
list = Enum.to_list(1..100_000) | |
Benchee.run(%{ | |
"List.last" => fn -> list |> List.last end, | |
"Enum.reverse |> hd" => fn -> list |> Enum.reverse |> hd end | |
}, time: 20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: