Skip to content

PragTob/bunny

Repository files navigation

this was an April's fools joke. However, bunny will remain functional. It's only implemented as a thing wrapper around benchee so unless we completely break API (which I don't see coming) it'll remain functional. Bunnytastic benchmarking to everyone.

Bunny Hex Version docs Inline docs Build Status Coverage Status

The bunnytastic benchmarking library formerly known as benchee. After all, benchmarking a function is just like a bunny eatings its input!

omnomnom function inputs

Installation

Get the bunny life into your elixir:

def deps do
  [
    {:bunny, ">= 0.1.0"}
  ]
end

Usage

For now most of the documentation is still over at benchee but everything works! All the options are implemented, it's just as fast and versatile as before.

However, it exposes a better and more expressive API for your pleasure. You know, bunny can't only run like the good old benchee. No! Bunny can also sleep, hop, eat and jump!

This all comes with your own personal bunny assistant that helps you benchmark:

list = Enum.to_list(1..10_000)
map_fun = fn(i) -> [i, i * i] end

Bunny.eat(%{
  "flat_map"    => fn -> Enum.flat_map(list, map_fun) end,
  "map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten end
})
tobi@speedy ~/github/bunny $ mix run samples/eat.exs
Bunny will take care of that for you!

   ( Y)
  ( . .)
 o(") (")

Operating System: Linux
CPU Information: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
Number of Available Cores: 8
Available memory: 15.61 GB
Elixir 1.8.0
Erlang 21.2.2

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
parallel: 1
inputs: none specified
Estimated total run time: 14 s

Benchmarking flat_map...
Benchmarking map.flatten...

Name                  ips        average  deviation         median         99th %
flat_map           2.32 K      430.51 μs    ±17.42%      412.75 μs      792.88 μs
map.flatten        1.22 K      817.24 μs    ±21.23%      750.79 μs     1241.15 μs

Comparison:
flat_map           2.32 K
map.flatten        1.22 K - 1.90x slower +386.73 μs

Bunny is done!

 () ()
 (* *)
o( 0 )

After all this hard work, bunny needs to rest a bit:

sleepy bunny is best bunny

About

April's fools for benchmarking 2018.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages