Skip to content

Tags: bencheeorg/benchee

Tags

1.3.1

Toggle 1.3.1's commit message
1.3.1 (2024-06-05)

Small release to remove warnings for the upcoming elixir 1.17 as well as add proper solaris support.

Features (User Facing)
* Solaris systems will now correctly be identified and have their CPU and memory parsed. Thanks to [@brianewell](https://github.com/brianewell)!

Bugfixes (User Facing)
* warnings on elixir-main/1.17-rc have been removed. Thanks to [@mhanberg](https://github.com/mhanberg) & [@alco](https://github.com/alco)!

1.3.0

Toggle 1.3.0's commit message
A big swath of bug fixes and improvements. The highlights certainly a…

…re fixes and conveniences around saved benchmarks and loading them again via the new `Benchee.report/1`. The other big one is saving a lot of memory (and time!) when processing big inputs. Sadly the latter comes with some breaking changes for plugins, but they are well justified and shouldn't actually affect any plugin in practice.

There's also a **known issue** for elixir 1.14.0 to 1.16.0-rc.0 - [read up about it](https://github.com/bencheeorg/benchee#known-issues).

* System information now includes whether or not the JIT is enabled ([erlang docs](https://www.erlang.org/doc/apps/erts/beamasm)).
* Benchee now let's you know when it's calculating statistics or running the formatters. Helps when you wonder what's taking so long or blows up memory.
* `Benchee.report/1` introduced if you just want to load saved benchmarks and report on them (---> run formatters).
* Configuration times will now be displayed in a more human friendly format (1 min 12 s vs. 1.2 min). Thanks to [@drobnyd](https://github.com/drobnyd).

* Memory usage should be massively reduced when dealing with larger sets of data in inputs or benchmarking functions. They were needlessly sent to processes calculating statistics or formatters which could lead to memory blowing up.
* Similarly, inputs and benchmarking functions will no longer be saved when using the `:save` option, this makes it immensely faster and depending on the size of the data a lot slower (I have an example with a factor 200x for the size). The side effect of this is that you also can't use `:load` and run the benchmarks saved again from just the file, this was never an intended use case though (as loading happens after benchmarking by default). You also still should have the benchmarking script so it's also not needed.
* Fix a bug where relative statistics would always rely on the inputs provided in the config, which can break when you load saved benchmarks but don't specify the `inputs` again.

Woopsie, didn't wanna do any of these in 1.x, sorry but there's good reason :( However, counting them as bugs.

* Formatters have lost access to benchmarking functions and the inputs, this is to enable huge memory and run time savings when using a lot of data. I also believe they should not be needed for formatters, please get in touch if this is a problem so we can work it out. In detail this means:
  * Each `Benchee.Scenario` struct in a formatter will have `:function` and `:input` set to `nil`
  * The `inputs` list in `Configuration` retains the input names, but the values will be set to `:scrubbed_see_1_3_0_changelog`. It may be completely scrubbed in the future, use the newly introduced `input_names` instead if you need easy access to all the input names at once.
  * Technically speaking formatters haven't generally lost access, only if they are processed in parallel - so not if it's the only formatter or if it's used via a function (`formatters: [fn suite -> MyFormatter.output(suite) end]`. Still, should not be used or relied upon.

* `jit_enabled?` is exposed as part of the `suite.system` struct
* Yes, `Benchee.System` is now a struct so feel easier about relying on the fields
* `Configuration` now has an `input_names` key that holds the name of all inputs, for the reasoning, see above.
* The more human friendly formats are accessible via `Format.format_human/2` or `Duration.format_human/1` (& friends)

1.2.0

Toggle 1.2.0's commit message
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.

Features (User Facing)
* Trying to benchmark evaluated functions will now result in a warning. Thanks [@BrooklinJazz](https://github.com/BrooklinJazz), [@czrpb](https://github.com/czrpb), [@aar2dee2](https://github.com/aar2dee2),[@ReecesPeanutButterCodes](https://github.com/ReecesPeanutButterCodes).
* Add support for the [`Table.Reader`](https://hexdocs.pm/table/Table.html) protocol so that benchee works out of the box in Livebook. See [#369](#369), big shoutout to [@akoutmos](https://github.com/akoutmos) and sorry for keeping it unreleased for so long.

Bugfixes (User Facing)
* Removed Elixir 1.16 compiler warnings around +0.0 and -0.0. Thanks [@TomcioP](https://github.com/tomciopp).
* Building an escript and running it is fixed. See [#384](#384) and thanks [@Munksgaard](https://github.com/Munksgaard)!

1.0.1

Toggle 1.0.1's commit message
* When memory measurements were actually different extended statistic…

…s was displayed although the option was not provided. Now correctly only displayed if the option is provided and values actually had variance.

1.0.0

Toggle 1.0.0's commit message
It's 0.99.0 without the deprecation warnings. Specifically:

* Old way of passing formatters (`:formatter_options`) vs. new `:formatters` with modules, tuples or functions with one arg
* The configuration needs to be passed as the second argument to `Benchee.run/2`
* `Benchee.collect/1` replaces `Benchee.measure/1`
* `unit_scaling` is a top level configuration option, not for the console formatter
* the warning for memory measurements not working on OTP <= 18 will also be dropped (we already officially dropped OTP 18 support in 0.14.0)

We're aiming to follow Semantic Versioning as we go forward. That means formatters should be safe to use `~> 1.0` (or even `>= 0.99.0 and < 2.0.0`).

0.99.0

Toggle 0.99.0's commit message
The "we're almost 1.0!" release - all the last small features, a bag …

…of polish and deprecation warnings. If you run this release succesfully without deprecation warnings you should be safe to upgrade to 1.0.0, if not - it's a bug :)

* changed official Elixir compatibility to `~> 1.6`, 1.4+ should still work but aren't guaranteed or tested against.

* the console comparison now also displays the absolute difference in the average (like +12 ms) so that you have an idea to how much time that translates to in your applications not just that it's 100x faster
* Overhaul of README, documentation, update samples etc. - a whole lot of things have also been marked `@doc false` as they're considered internal

* Remove double empty line after configuration display
* Fix some wrong type specs

* `Scenario` made it to the big leagues, it's no longer `Benchee.Benchmark.Scenario` but `Benchee.Scenario` - as it is arguably one of our most important data structures.
* The `Scenario` struct had some keys changed (last time before 2.0 I promise!) - instead of `:run_times`/`:run_time_statistics` you now have one `run_time_data` key that contains `Benchee.CollectionData` which has the keys `:samples` and `:statistics`. Same for `memory_usage`. This was done to be able to handle different kinds of measurements more uniformly as we will add more of them.

* `Benchee.Statistics` comes with 3 new values: `:relative_more`, `:relative_less`, `:absolute_difference` so that you don't have to calculate these relative values yourself :)

0.14.0

Toggle 0.14.0's commit message
* dropped support for Erlang 18.x

* Formatters no longer have an `output/1` method, instead use `Formatter.output/3` please
* Usage of `formatter_options` is deprecated, instead please use the new tuple way

* benchee now uses the maximum precision available to measure which on Linux and OSX is nanoseonds instead of microseconds. Somewhat surprisingly `:timer.tc/1` always cut down to microseconds although better precision is available.
* The preferred way to specify formatters and their options is to specify them as a tuple `{module, options}` instead of using `formatter_options`.
* New `Formatter.output/1` function that takes a suite and uses all configured formatters to output their results
* Add the concept of a benchmarking title that formatters can pick up
* the displayed percentiles can now be adjusted
* inputs option can now be an ordered list of tuples, this way you can determine their order
* support FreeBSD properly (system metrics) - thanks @[kimshrier](/kimshrier)

* Remove extra double quotes in operating system report line - thanks @[kimshrier](/kimshrier)

* all reported times are now in nanoseconds instead of microseconds
* formatter methods `format` and `write` now take 2 arguments each where the additional arguments is the options specified for this formatter so that you have direct access to it without peeling it from the suite
* You can no longer `use Benchee.Formatter` - just adopt the behaviour (no more auto generated `output/1` method, but `Formatter.output/3` takes that responsibility now)

* An optional title is now available in the suite for you to display
* Scenarios are now sorted already sorted (first by run time, then memory usage) - no need to sort them yourself!
* Add `Scenario.data_processed?/2` to check if either run time or memory data has had statistics generated

0.13.2

Toggle 0.13.2's commit message
bump it up 0.13.2

0.13.1

Toggle 0.13.1's commit message
Mostly fixing memory measurement bugs and related issues :) Enjoy a b…

…etter memory measurement experience from now on!

* Memory measurements now correctly take the old generation on the heap into account. In reality that means sometimes bigger results and no missing measurements. See [#216](#216) for details. Thanks to @michalmuskala for providing an interesting sample.
* Formatters are now more robust (aka not crashing) when dealing with partially missing memory measurements. Although it shouldn't happen anymore with the item before fixed, benchee shouldn't crash on you so we want to be on the safe side.
* It's now possible to run just memory measurements (i.e. `time: 0, warmup: 0, memory_time: 1`)
* even when you already have scenarios tagged with `-2` etc. it still correctly produces `-3`, `-4` etc. when saving again with the same "base tage name"