Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.01 KB

File metadata and controls

46 lines (32 loc) · 1.01 KB

Contributing to fast-elixir

Thank you for contributing! Let's get you started!

Adding a benchmark

  1. Fork and clone the repository

  2. Install the Elixir/Erlang versions in .tool-versions

  3. Install dependencies: mix deps.get

  4. Write a benchmark using the following template:

    defmodule IdiomName.Fast do
      def function_name do
      end
    end
    
    defmodule IdiomName.Slow do
      def function_name do
      end
    end
    
    defmodule IdiomName.Benchmark do
      def benchmark do
        Benchee.run(%{
          "Idiom Name Fast" => fn -> bench(IdiomName.Fast) end,
          "Idiom Name Slow" => fn -> bench(IdiomName.Slow) end,
        }, time: 10, print: [fast_warning: false])
      end
    
      defp bench(module) do
        module.function_name
      end
    end
    
    IdiomName.Benchmark.benchmark()
  5. Run your benchmark: mix run code/<category>/<benchmark>.exs

  6. Add the output along with a description to the README

  7. Open a Pull Request!