Sha256: 5c1c041da3b34e2e359125293d0da3fef30051ca95b8bccb3ec0eafe45902110

Contents?: true

Size: 704 Bytes

Versions: 12

Compression:

Stored size: 704 Bytes

Contents

$:.unshift File.expand_path("../../lib", __FILE__)

require 'benchmark'
require 'daru'

df = Daru::DataFrame.new({
  a: 10000.times.map { rand },
  b: 10000.times.map { rand },
  c: 10000.times.map { rand }
})

Benchmark.bm do |x|
  x.report("Single Vector access") do
    df[:a]
  end

  x.report("Access as range") do
    df[:a..:c]
  end

  x.report("Access with commas") do
    df[:a, :c]
  end
end

# ======== Benchmarks =======
#
#                         user     system      total        real
# Single Vector access  0.000000   0.000000   0.000000 (  0.000012)
# Access as range       0.090000   0.000000   0.090000 (  0.084584)
# Access with commas    0.050000   0.000000   0.050000 (  0.051951)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
daru-0.3 benchmarks/vector_access.rb
daru-0.2.2 benchmarks/vector_access.rb
daru-0.2.1 benchmarks/vector_access.rb
daru-0.2.0 benchmarks/vector_access.rb
daru-0.1.6 benchmarks/vector_access.rb
daru-0.1.5 benchmarks/vector_access.rb
daru-0.1.4.1 benchmarks/vector_access.rb
daru-0.1.4 benchmarks/vector_access.rb
daru-0.1.3.1 benchmarks/vector_access.rb
daru-0.1.3 benchmarks/vector_access.rb
daru-0.1.2 benchmarks/vector_access.rb
daru-0.1.1 benchmarks/vector_access.rb