This file contains hidden or 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
john = "John Lennon" | |
ringo = "Ringo Starr" | |
paul = "Paul McCartney" | |
george = "George Harrison" | |
beatles = [john, ringo, paul, george] | |
sorted_beatles = beatles.sort | |
puts sorted_beatles |
This file contains hidden or 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
Verifying my Blockstack ID is secured with the address 1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d https://explorer.blockstack.org/address/1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d |
This file contains hidden or 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
Mix.install([:benchee]) | |
defmodule Test do | |
def benchmark() do | |
vector1 = Enum.map(1..1536, fn _ -> :rand.uniform() end) | |
vector2 = Enum.map(1..1536, fn _ -> :rand.uniform() end) | |
Benchee.run( | |
%{ | |
"dot_product_enum" => fn -> dot_product_enum(vector1, vector2) end, |
OlderNewer