Marcus

Marcus

BencheeDsl - ExUnit style and a livebook smart cell for benchee

Hi!

BencheeDsl provides a DSL for the great Benchee (micro) benchmarking tool.

With the DSL you can write benchmarks like:

defmodule Benchmark do
  use BencheeDsl.Benchmark

  config time: 3, pre_check: true, print: [configuration: false]

  inputs %{
    "Small" => Enum.to_list(1..1_000),
    "Medium" => Enum.to_list(1..10_000),
    "Bigger" => Enum.to_list(1..100_000)
  }

  defp map_fun(i), do: [i, i * i]

  job flat_map(input) do
    Enum.flat_map(input, &map_fun/1)
  end

  job map_flatten(input) do
    input |> Enum.map(&map_fun/1) |> List.flatten()
  end
end

The lib comes with two mix tasks. One to generate the bench directory and bench/benchee_helper.exs. The mix bench task will run the benchmarks found by bench/*_bench.exs.

BencheeDsl comes also with support for livebook and with the Benchee smart cell. See benchee_dsl.livemd.

The Benchee smart cell is my very first attempt at writing a smart cell.

Thanks for reading!

Most Liked

Marcus

Marcus

The smart cell renders now markdown when benchee_markdown is installed.

Marcus

Marcus

I was wondering how your Livebook integration differs from kino_benchee , and whether it might make sense for you to contribute any enhancements you’ve made to that project, if you have the time.

In benchee_dsl the integration is quite easy, just %Benchee.Suite{} |> Benchee.Formaters.Markdown.redner() |> Kino.Markdown.new(). kino_benchee implements defimpl Kino.Render, for: Benchee.Suite. So the implementation is cleaner and more general. kino_benchee uses also some new upcoming features of Livebook next version and renders some nice charts with kino_vega_lite. The package waits for on change in benchee and for the next Livebook version. I will remove the Livebook integration in benchee_dsl as soon as kino_benchee is available.

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
kelvinst
Hey everyone! Well, we made this lib a while ago and now we decided to finally go out and public with it! It’s a tool for creating and m...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement