
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
BME is a simple wrapper around ruby's Benchmark library which helps you write benchmark code that is clearer, simpler, and more meaningful.
A normal benchmark with the 'benchmark' library can quickly get untidy:
require 'benchmark'
iterations = 100,000
Benchmark.bm do |bm|
bm.report 'some_method' do
iterations.times { Library.some_method(args) }
end
end
As you add more benchmarks, those iterations will start to get in the way of the important code. A benchmark with BME is cleaner -- the code being tested is more apparent:
require 'bme'
BME.benchmark do |bm|
bm.report 'some_method' do
Library.some_method(args)
end
end
By default, BME iterates over each piece of code 100,000 times. Use the :iterations option to override the default behaviour for all benchmarks:
BME.benchmark(:iterations => 500) do |bm|
# ...
end
Or on a per-benchmark basis:
BME.benchmark do |bm|
bm.report 'some_method' do
Library.some_method(args)
end
bm.report 'other_method', :iterations => 500 do
Library.other_method(args)
end
end
That's it!
$ gem install bme --source http://gemcutter.org
Copyright (c) 2009 James Wilding. See LICENSE for details.
FAQs
Unknown package
We found that bme demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.