bencheeorg / bencheeorg/benchee
Promote use of keywords lists instead maps for job list
- Dominant language
- Elixir
- Stars
- 1.5k
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
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.
```elixir
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at Benchee.run/2 and its function specs, then inspect the README benchmark examples. Confirm how keyword lists and maps are handled and update the documented examples and specs so ordered job lists are supported consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100