Sha256: fb6e86719825bb8470b22b45bbc56d0c006411630bda19dc77f350b50030ccb3
Contents?: true
Size: 471 Bytes
Versions: 2
Compression:
Stored size: 471 Bytes
Contents
# # To test latency on writing large chunks of data in one go # $: << "../lib" require 'benchmark' require 'file_writer' data = " " * (16_777_216*100 + 42) t1 = Thread.new do loop do FileWriter.write("./test", data) end end accum = [] t2 = Thread.new do loop do b = Benchmark.measure do 100000.times do " "*1024 end end accum << b.total break if accum.length > 1000 end p accum.sum / accum.size end t1.join t2.join
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
file_writer-0.2.0 | tests/latency.rb |
file_writer-0.1.4 | tests/latency.rb |