Skip to content

Promote use of keywords lists instead maps for job list #333

Description

@eksperimental

Hi @PragTob, first of all, thank you for such an amazing library, it helps me every now and then to make Elixir an even better language.

I would like to suggest to change from maps to keywords lists for the list of jobs.
The reason is that since map is not an ordered structure, it may change the order of the execution depending on the name of the key.
As of now, Benchee.run/2 works with either maps and keyword lists since it takes any enumerable.
The specs for this function should also be updated.

The examples in the README file would also look like this.

Benchee.run(
  [
    "flat_map": fn -> Enum.flat_map(list, map_fun) end,
    "map.flatten": fn -> list |> Enum.map(map_fun) |> List.flatten() end
  ]
)

This is the way I set all my benchmarks.
Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions