Sha256: 93029f024834f0bccb39895e1d468b289adf31496b5d9e5ceb88b1abf9cd7db5
Contents?: true
Size: 466 Bytes
Versions: 3
Compression:
Stored size: 466 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' def lengthy_op 10.times { IO.orig_read(__FILE__) } end X = 1000 def blocking t0 = Time.now data = lengthy_op X.times { lengthy_op } puts "read blocking (#{Time.now - t0}s)" end def threaded t0 = Time.now data = Polyphony::Thread.process { lengthy_op } X.times { Polyphony::Thread.process { lengthy_op } } puts "read threaded (#{Time.now - t0}s)" end blocking threaded
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
polyphony-0.26 | examples/performance/thread.rb |
polyphony-0.25 | examples/performance/thread.rb |
polyphony-0.24 | examples/performance/thread.rb |