README.md in rubype-0.3.0 vs README.md in rubype-0.3.1
- old
+ new
@@ -178,61 +178,26 @@
# => Numeric
```
## Benchmarks
-```ruby
-require 'rubype'
-require 'benchmark'
+#### result of `bundle exec rake benchmark`
-class RubypeCommonClass
- def sum(x, y)
- x + y
- end
- typesig :sum, [Numeric, Numeric] => Numeric
-end
+Ruby 2.2.1, Macbook Pro 2.7Ghz Intel Core i5, 8GB RAM
-class CommonClass
- def sum(x, y)
- x + y
- end
-end
-
-class RubypeDucktypeClass
- def sum(x, y)
- x.to_i + y
- end
- typesig :sum, [:to_i, Numeric] => Numeric
-end
-
-class DucktypeClass
- def sum(x, y)
- x.to_i + y
- end
-end
-
-N = 100_000
-Benchmark.bm("RubypeDucktypeClass".length + 3) do |x|
- x.report("RubypeCommonClass") { N.times { RubypeCommonClass.new.sum(1, 5) } }
- x.report("CommonClass") { N.times { CommonClass.new.sum(1, 5) } }
-end
-
-Benchmark.bm("RubypeDucktypeClass".length + 3) do |x|
- x.report("RubypeDucktypeClass") { N.times { RubypeDucktypeClass.new.sum(1, 5) } }
- x.report("DucktypeClass") { N.times { DucktypeClass.new.sum(1, 5) } }
-end
```
+ruby version: 2.2.1
+rubype version: 0.3.0
+Calculating -------------------------------------
+ Pure Ruby 101.070k i/100ms
+ Rubype 63.973k i/100ms
+-------------------------------------------------
+ Pure Ruby 7.115M (± 6.1%) i/s - 35.476M
+ Rubype 1.537M (± 2.5%) i/s - 7.677M
-### Results
-Ruby 2.2.0, Macbook Pro 2.9Ghz Intel Core i7, 8GB RAM
-
-```
- user system total real
-RubypeCommonClass 0.530000 0.010000 0.540000 ( 0.566493)
-CommonClass 0.030000 0.000000 0.030000 ( 0.035718)
- user system total real
-RubypeDucktypeClass 0.590000 0.010000 0.600000 ( 0.682504)
-DucktypeClass 0.030000 0.000000 0.030000 ( 0.029856)
+Comparison:
+ Pure Ruby: 7114786.0 i/s
+ Rubype: 1536611.5 i/s - 4.63x slower
```
## Installation