Created
August 15, 2016 18:04
-
-
Save lokeshh/13ae3d100d6294c0c2d216c62170915f to your computer and use it in GitHub Desktop.
This file contains 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 'benchmark' | |
n = 100000 | |
dv = Daru::Vector.new 1..n | |
# For current branch | |
Benchmark.bm do |x| | |
x.report do | |
100.times { dv[0] = nil } | |
end | |
x.report do | |
10.times do | |
dv[0] = nil | |
10.times { dv.reject_values nil } | |
end | |
end | |
end | |
require 'benchmark' | |
n = 100000 | |
dv = Daru::Vector.new 1..n | |
# For master branch | |
Benchmark.bm do |x| | |
x.report do | |
100.times { dv[0] = nil } | |
end | |
x.report do | |
10.times do | |
dv[0] = nil | |
10.times { dv.only_valid nil } | |
end | |
end | |
end | |
# Missing values Branch | |
user system total real | |
0.000000 0.000000 0.000000 ( 0.000308) | |
11.120000 0.160000 11.280000 ( 11.385459) | |
# Master branch | |
user system total real | |
1.840000 0.000000 1.840000 ( 1.840055) | |
15.080000 0.060000 15.140000 ( 15.462978) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment