Last active
December 10, 2015 13:08
-
-
Save bpot/4439002 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'benchmark/ips' | |
| class ExampleClass | |
| def foo; 42; end | |
| end | |
| module ExampleMixin | |
| def foo; 43; end | |
| end | |
| Benchmark.ips do |bm| | |
| bm.report("without dci") { ExampleClass.new } | |
| bm.report("with dci") do | |
| obj = ExampleClass.new | |
| obj.extend(ExampleMixin) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Calculating ------------------------------------- | |
| without dci 79043 i/100ms | |
| with dci 24489 i/100ms | |
| ------------------------------------------------- | |
| without dci 3017563.1 (±2.6%) i/s - 15097213 in 5.006974s | |
| with dci 558150.9 (±3.2%) i/s - 2791746 in 5.006372s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Calculating ------------------------------------- | |
| without dci 71499 i/100ms | |
| with dci 24065 i/100ms | |
| ------------------------------------------------- | |
| without dci 2680264.1 (±1.2%) i/s - 13441812 in 5.015815s | |
| with dci 532601.9 (±3.6%) i/s - 2671215 in 5.021179s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment