Skip to content

Commit

Permalink
Merge f03b40a into b0353c7
Browse files Browse the repository at this point in the history
  • Loading branch information
devonestes committed Jul 6, 2018
2 parents b0353c7 + f03b40a commit 7b89fb1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/benchee/system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ defmodule Benchee.System do
cpu_speed: cpu_speed()
}

warn_about_performance_degrading_settings()

%Suite{suite | system: system_info}
end

Expand Down Expand Up @@ -164,4 +166,22 @@ defmodule Benchee.System do
output
end
end

defp warn_about_performance_degrading_settings do
unless all_protocols_consolidated?() do
IO.puts("""
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.
""")
end
end

defp all_protocols_consolidated? do
path = :code.lib_dir(:elixir, :ebin)

[path]
|> Protocol.extract_protocols()
|> Enum.all?(&Protocol.consolidated?/1)
end
end

0 comments on commit 7b89fb1

Please sign in to comment.