Sha256: 5ae8b833a75ec0699ea14ba90e00e4666033d747e3db3a593eb086eb29c06a76
Contents?: true
Size: 1 KB
Versions: 5
Compression:
Stored size: 1 KB
Contents
require 'daru' require 'benchmark' vector = Daru::Vector.new( (10**6).times.map.to_a.shuffle, missing_values: 100.times.map.to_a.shuffle ) vector_gsl = Daru::Vector.new( 10000.times.map.to_a.shuffle, missing_values: 100.times.map.to_a.shuffle, dtype: :gsl ) Benchmark.bm do |x| x.report("Mean of a vector") do vector.mean end x.report("Minimum of a vector") do vector.min end x.report("Mean of a vector with data type gsl") do vector_gsl.mean end x.report "Minimum of a vector with data type gsl" do vector_gsl.min end end # ===== Benchmarks ===== # # user system total real # Mean of a vector 0.130000 0.010000 0.140000 ( 0.145534) # Min of a vector 0.150000 0.000000 0.150000 ( 0.163623) # Mean of a gsl vector 0.000000 0.000000 0.000000 ( 0.001037) # Min of a gsl vector 0.000000 0.000000 0.000000 ( 0.001251)
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
daru-0.1.5 | benchmarks/statistics.rb |
daru-0.1.4.1 | benchmarks/statistics.rb |
daru-0.1.4 | benchmarks/statistics.rb |
daru-0.1.3.1 | benchmarks/statistics.rb |
daru-0.1.3 | benchmarks/statistics.rb |