An easy and extensible benchmarking library for Elixir that provides comprehensive statistics and memory measurements.
Benchee is a feature-rich benchmarking library for Elixir that allows developers to compare the performance of different code snippets with ease. It provides detailed statistics, supports multiple metrics like execution time, memory consumption, and reductions, and is designed to be extensible through plugins. The library solves the problem of accurately measuring and analyzing code performance across various inputs and scenarios.
Elixir developers who need to benchmark and optimize code performance, including those working on libraries, applications, or micro-optimizations where precise measurements of time, memory, and reductions are critical. It is also suitable for teams integrating performance testing into CI/CD pipelines.
Developers choose Benchee over alternatives because it offers a comprehensive set of features out-of-the-box, including multiple metrics, extensible architecture with plugins, and detailed statistical analysis. Its unique selling point is the combination of ease of use, accuracy with nanosecond precision, and flexibility through hooks, parallel execution, and integration with profilers for deeper performance insights.
Easy and extensible benchmarking in Elixir providing you with lots of statistics!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Measures execution time, memory consumption, and reductions independently, providing a holistic view of code efficiency as detailed in the metrics section.
Offers detailed statistics like average, median, 99th percentile, and optional extended stats such as mode and sample size, enabling accurate performance assessment.
Supports plugins for output formats like HTML, CSV, and JSON, and allows custom formatters, making it adaptable to various workflows and integration needs.
Includes setup, teardown, and before/after hooks for scenarios and invocations, enabling state management without affecting measurements, which is crucial for realistic benchmarks.
Known issues with Elixir versions 1.14.0 to 1.16.0-rc.0 disable optimizations for top-level functions, potentially skewing benchmarks unless code is placed in modules, adding complexity.
Usage from Erlang requires additional setup with rebar3 plugins and has noted reliability issues, making it less accessible for pure Erlang projects compared to Elixir.
Time measurement accuracy can be as low as 10ms on Windows in CI environments, affecting nano-benchmarks and necessitating Linux for precise results, limiting cross-platform consistency.