Created
January 7, 2024 13:34
-
-
Save PragTob/245539b511ff74c1c76ea2a3a009206f 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
map_fun = fn i -> i + 1 end | |
inputs = [ | |
{"Small (10 Thousand)", Enum.to_list(1..10_000)}, | |
{"Middle (100 Thousand)", Enum.to_list(1..100_000)}, | |
{"Big (1 Million)", Enum.to_list(1..1_000_000)}, | |
{"Giant (10 Million)", Enum.to_list(1..10_000_000)}, | |
{"Titanic (50 Million)", Enum.to_list(1..50_000_000)} | |
] | |
tag = System.get_env("TAG") | |
Benchee.run( | |
%{ | |
"tail" => fn list -> MyMap.map_tco(list, map_fun) end, | |
"body" => fn list -> MyMap.map_body(list, map_fun) end, | |
"tail +order" => fn list -> MyMap.map_tco_arg_order(list, map_fun) end | |
}, | |
warmup: 5, | |
time: 40, | |
# memory measurements are stable/all the same | |
memory_time: 0.1, | |
inputs: inputs, | |
formatters: [ | |
{Benchee.Formatters.Console, extended_statistics: true} | |
], | |
save: [tag: tag, path: "benchmarks/saves/tco_#{tag}.benchee"] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment