Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created March 30, 2016 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/da706eeb1a3b80aaac980743cb21a0b2 to your computer and use it in GitHub Desktop.
Save havenwood/da706eeb1a3b80aaac980743cb21a0b2 to your computer and use it in GitHub Desktop.
Instance and local off to the races!
>> Benchmark.ips do |ips|
| ips.report 'local' do
| ex = 1
| ex
| end
|
| ips.report 'instance' do
| @ex = 1
| @ex
| end
| end
Warming up --------------------------------------
local 157.537k i/100ms
instance 148.740k i/100ms
Calculating -------------------------------------
local 4.599M (± 5.0%) i/s - 23.000M
instance 3.769M (± 4.9%) i/s - 18.890M
>> Benchmark.ips do |ips|
| ips.report 'local' do
| ex = 1
| ex
| end
|
| ips.report 'instance' do
| @ex = 1
| @ex
| end
| end
Warming up --------------------------------------
local 186.040k i/100ms
instance 153.983k i/100ms
Calculating -------------------------------------
local 14.143M (± 6.6%) i/s - 70.323M
instance 13.365M (± 7.7%) i/s - 66.367M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment