
Security News
Nx npm Packages Compromised in Supply Chain Attack Leveraging AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.