Sha256: c3b05600e4d6460b8f28a0d01e8e40f05ccbcfba41afd0906bd6e46432b2f04c

Contents?: true

Size: 501 Bytes

Versions: 8

Compression:

Stored size: 501 Bytes

Contents

contexts:
  - name: "master"
    prelude: |-
      require 'bundler/setup'
      require 'enumerable/statistics'
prelude: |-
  n = 1000
  ary = Array.new(n) { rand }
benchmark:
  inject: sum = ary.inject(:+)
  while: |-
    i, sum = 0, 0
    while i < n
      sum += ary[i]
      i += 1
    end
  pure_ruby: |-
    i, f, c = 0, 0.0, 0.0, 0.0, 0.0
    while i < n
      x = ary[i]
      y = x - c
      t = f + y
      c = (t - f) - y
      f = t

      i += 1
    end
    sum = f
  sum: sum = ary.sum

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
enumerable-statistics-2.0.7 bench/sum.yml
enumerable-statistics-2.0.6 bench/sum.yml
enumerable-statistics-2.0.5 bench/sum.yml
enumerable-statistics-2.0.3 bench/sum.yml
enumerable-statistics-2.0.2 bench/sum.yml
enumerable-statistics-2.0.1 bench/sum.yml
enumerable-statistics-2.0.0 bench/sum.yml
enumerable-statistics-2.0.0.pre bench/sum.yml