Sha256: 349f70d63f473e493435a2c34b32ed625ab854af83e2787997e78a0792691d95

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

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

require 'benchmark'
require 'daru_lite'

df = DaruLite::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

4 entries across 4 versions & 1 rubygems

Version Path
daru_lite-0.1.3 benchmarks/vector_access.rb
daru_lite-0.1.2 benchmarks/vector_access.rb
daru_lite-0.1.1 benchmarks/vector_access.rb
daru_lite-0.1 benchmarks/vector_access.rb