Skip to content

Commit

Permalink
Expose JIT enabled as part of the system information printed before b…
Browse files Browse the repository at this point in the history
…enchmarking
  • Loading branch information
PragTob committed Nov 16, 2023
1 parent f52f195 commit 62cdc52
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Features (User Facing)
* System information now includes whether or not the JIT is enabled ([erlang docs](https://www.erlang.org/doc/apps/erts/beamasm)).

### Features (Plugins)
* `jit_enabled?` is exposed as part of the `suite.system` map

## 1.2.0 (2023-11-09)

Long time, huh? 😉 I'm not gonna repeat all that, but I'm happy benchee is in a place where it just works and doesn't need too much support. Biggest feature here is the implementation of the `Table.Reader` protocol for a better Livebook experience.
Expand Down
2 changes: 2 additions & 0 deletions lib/benchee/output/benchmark_printer.ex
Expand Up @@ -44,6 +44,7 @@ defmodule Benchee.Output.BenchmarkPrinter do
defp system_information(%{
erlang: erlang_version,
elixir: elixir_version,
jit_enabled?: jit_enabled?,
os: os,
num_cores: num_cores,
cpu_speed: cpu_speed,
Expand All @@ -56,6 +57,7 @@ defmodule Benchee.Output.BenchmarkPrinter do
Available memory: #{available_memory}
Elixir #{elixir_version}
Erlang #{erlang_version}
JIT enabled: #{jit_enabled?}
""")
end

Expand Down
10 changes: 6 additions & 4 deletions test/benchee/output/benchmark_printer_test.exs
Expand Up @@ -7,8 +7,9 @@ defmodule Benchee.Output.BenchmarkPrintertest do
import Benchee.Output.BenchmarkPrinter

@system_info %{
elixir: "1.4",
erlang: "19.2",
elixir: "1.15.7",
erlang: "26.1",
jit_enabled?: true,
os: :macOS,
num_cores: 4,
cpu_speed: "Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz",
Expand Down Expand Up @@ -37,8 +38,9 @@ defmodule Benchee.Output.BenchmarkPrintertest do
|> configuration_information
end)

assert output =~ "Erlang 19.2"
assert output =~ "Elixir 1.4"
assert output =~ "Erlang 26.1"
assert output =~ "Elixir 1.15.7"
assert output =~ ~r/jit.*.true/i
assert output =~ "Intel"
assert output =~ "Cores: 4"
assert output =~ "macOS"
Expand Down

0 comments on commit 62cdc52

Please sign in to comment.