Sha256: 8980279fe13dcb71b6329701986f09876b8a7e119a3d4939dc0c2f9b55144d8a
Contents?: true
Size: 478 Bytes
Versions: 2
Compression:
Stored size: 478 Bytes
Contents
require 'pry' require 'benchmark' require 'concurrent' @message_queue = Concurrent::Array.new 10000.times { @message_queue << Class.new } 1.times do Benchmark.bmbm do |x| x.report("reader") { 100000.times { @message_queue } } end Benchmark.bmbm do |x| x.report("dup") { 100000.times { @message_queue.dup } } end Benchmark.bmbm do |x| # This is super slow..... x.report("internal dup") { 100.times { @message_queue.map(&:dup) } } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sqs_buffer-0.3.7 | benchmark/spike.rb |
sqs_buffer-0.3.6 | benchmark/spike.rb |