Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration options to override Benchee default values #45

Open
PragTob opened this issue Oct 12, 2016 · 8 comments
Open

Add configuration options to override Benchee default values #45

PragTob opened this issue Oct 12, 2016 · 8 comments

Comments

@PragTob
Copy link
Member

PragTob commented Oct 12, 2016

Benchee is getting a lot of configuration options - which is great. But the more configurations options and formatters there are, the more people would probably prefer to configure some of them globally for their project.

Something like:

config :benchee, :options, %{} # fancy map or keyword list overriding default options

These options should then represent the new default options. So merge order would be something like: default_config <- app_config <- benchmark_config (<- meaning right overrides left)

@h4cc
Copy link

h4cc commented Feb 26, 2017

Default config can be found here: https://github.com/PragTob/benchee/blob/master/lib/benchee/config.ex#L156

Example for mix config: https://hexdocs.pm/mix/Mix.Config.html

@h4cc
Copy link

h4cc commented Feb 28, 2017

Is it ok for config to be included at compile time?

  @default_config %{
    parallel:   Application.fetch_env!(:benchee, :parallel, 1),
  }

@h4cc
Copy link

h4cc commented Feb 28, 2017

Working on this.

@PragTob PragTob added this to the 1.0 milestone Mar 10, 2018
@devonestes
Copy link
Collaborator

So, in light of the recent configuration guidelines, should we still do this? I think we can totally get away without application config.

@PragTob
Copy link
Member Author

PragTob commented Jul 15, 2018

It's something that I still don't fully understand.

I still think saying that I always want to use the HTML formatter might be useful and I dunno how else to best do it otherwise.

On the other hand, if people want that they could write their own little wrapper.

@devonestes
Copy link
Collaborator

We could do what Credo does and have a .benchee.exs file that's read as default configuration at runtime. That way we're not dealing with compile time configuration (which I believe is what those configuration guidelines are helping to prevent).

@PragTob
Copy link
Member Author

PragTob commented Jul 16, 2018

Good point 👏

Although until we have a way to specify paths without mentioning the file name this isn't essential to me. So I'll also remove the 1.0 milestone

@PragTob PragTob removed this from the 1.0 milestone Jul 16, 2018
@PragTob
Copy link
Member Author

PragTob commented Dec 23, 2023

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

No branches or pull requests

3 participants