Sha256: fa40e6b083456c17a87b44b4112184af4c927a42d68f35ae0b93e953f0a2c569
Contents?: true
Size: 869 Bytes
Versions: 15
Compression:
Stored size: 869 Bytes
Contents
# encoding: ascii-8bit require_relative '../spec_helper' require_relative '../helpers/fake_blockchain' require 'benchmark' [ [:sequel, :postgres] ].compact.each do |options| next unless storage = setup_db(*options) describe "#{storage.backend_name} block storage" do before do @store = storage @store.reset @store.log.level = :error @fake_chain = FakeBlockchain.new 10 end it "block storage" do blocks = (0..10).to_a.map{|i| @fake_chain.block(i) } bm = Benchmark.measure do bm = Benchmark.bm do |b| blocks.each.with_index do |blk,i| b.report("storing fake block ##{i}") do depth, chain = @store.new_block blk chain.should == 0 end end end end puts '-'*80 puts "TOTAL #{bm.format}" end end end
Version data entries
15 entries across 15 versions & 2 rubygems