Sha256: 84427099fa1267a022b1329c20f175ab2069c1537c6d2988c5eb18eeaa2f5795

Contents?: true

Size: 897 Bytes

Versions: 11

Compression:

Stored size: 897 Bytes

Contents

require 'bundler'
require 'bundler/setup'
require 'jsonify'
require 'benchmark'

class Speed
  def self.test
    Benchmark.bm do |b|
      b.report('Jsonify') do
        15_000.times {
          j = Jsonify::Builder.new
          j.name "Garrett Bjerkhoel"
          j.birthday Time.local(1991, 9, 14)
          j.street do
            j.address "1143 1st Ave"
            j.address2 "Apt 200"
            j.city "New York"
            j.state "New York"
            j.zip 10065
          end
          j.skills do
            j.ruby true
            j.asp false
            j.php true
            j.mysql true
            j.mongodb true
            j.haproxy true
            j.marathon false
          end
          j.single_skills ['ruby', 'php', 'mysql', 'mongodb', 'haproxy']
          j.booleans [true, true, false, nil]
          j.compile!
        }
      end
    end
  end
end

Speed.test

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jsonify-0.4.1 performance/speed.rb
jsonify-0.4.0 performance/speed.rb
jsonify-0.3.1 performance/speed.rb
jsonify-0.3.0 performance/speed.rb
jsonify-0.2.0 performance/speed.rb
jsonify-0.1.3 performance/speed.rb
jsonify-0.1.2 performance/speed.rb
jsonify-0.1.1 performance/speed.rb
jsonify-0.1.0 performance/speed.rb
jsonify-0.0.9 performance/speed.rb
jsonify-0.0.8 spec/speed.rb