Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

benny

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

benny

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Benny, your Ruby benchmarking buddy

This tool was created to answer the question: How does this version of a library compare to another version of the same library? For a familiar feel for Rubyists, rspec has been as inspiration for how benchmarks are structured and defined.

Basic structure of a benchmarking project

A simple benchmark project looks something like this. To generate such a project you can execute:

gem install benny
benny init my_benny_project
my_benny_project/
    ├── benchmarks/
    │   ├── bench_helper.rb
    │   └── test_bench.rb
    ├── gemfiles/
    │   ├── version-1.gemfile
    │   └── version-2.gemfile
    └── Gemfile

Gemfile

Dependencies are managed by bundler and therefore a Gemfile is required

source 'https://rubygems.org'

gem 'benny'

benchmarks/ folder

Contains files that define environments and benchmarks.

benchmarks/bench_helper.rb

Configures the benchmarks and defines the different environments

A simple configuration configuring two environments to be compared:

Benny.configure do |config|
  config.environment 'Version 1' do
    gemfile 'gemfiles/version-1.gemfile'
  end
  config.environment 'Version 2' do
    gemfile 'gemfiles/version-2.gemfile'
  end
end

benchmarks/*_bench.rb files

All the files ending with the suffix _bench.rb will be evaluated and added to the benchmark suite.

Benny.define do
  benchmark 'Simple calculation' do
    700_000.times do
      sum = 1+1
    end
  end
end

gemfiles/ folder

The gemfile folder contains the different Gemfiles for version variations. These are referenced from the benchmark/bench_helper.rb file. Aappraisal can be used in combination with Benny for managing the different gemfiles.

Defining benchmarks

TBD

Reporters

TBD

Development and Tests

How to contribute

See CONTRIBUTING.

License

See LICENSE.

FAQs

Package last updated on 22 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc