mguimas

mguimas

How to disable protocol consolidation warning from Benchee?

Hello,

Even though I have already done mix clean --all --deps, I still get the next message from Benchee:

Not all of your protocols have been consolidated. In order to achieve the
best possible accuracy for benchmarks, please ensure protocol
consolidation is enabled in your benchmarking environment.

What do I have to do to remove this message?

I am using

$ elixir --version
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.16.0 (compiled with Erlang/OTP 26)

and have the following line in my mix.exs

{:benchee, "~> 1.3", only: [:dev, :test]}

Also, I am running mix test and calling Benchee from a compiled function called from a test.

Thanks

Most Liked

PragTob

PragTob

Hi there,

sounds like your protocols aren’t consolidated - I’m not 100% sure but it may be that you have protocols defined in .exs files and hence they aren’t consolidated? There is some more information here: Protocol — Elixir v1.16.1

benchee checks all protocols for consolidation: benchee/lib/benchee/system.ex at d1228710390ee9d871a7b31e8e458a4b334c7790 · bencheeorg/benchee · GitHub

Maybe you’ve also disabled it in test (as mentioned in the article there).

It’s hard to tell without a code base to access. Right now that warning message can’t be deactivated as it’s one of our “hard warnings” I’d say. Might be persuaded to add a deactivation for it, but generally speaking all protocols should be consolidated for benchmarking.

mguimas

mguimas

I went to check that, and guess what, I had this in my mix.exs:

consolidate_protocols: Mix.env() != :test

I did not go there before because I don’t remember to have added that myself to the mix.exs file.

Perhaps this is some default added when the project was created some time ago? :man_shrugging:

Thanks a lot people!!

dimitarvp

dimitarvp

The link to the Elixir docs shows that usually projects disable protocol consolidation in the test env – have you checked if that’s true for your project?

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement