Sha256: 192a5e1a332503591a83bc7c325c0102039ef92d33a7c12544beb7e88d5f6c9f
Contents?: true
Size: 595 Bytes
Versions: 11
Compression:
Stored size: 595 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' def bm(fibers, iterations) count = 0 t_pre = Time.now fibers.times do spin do iterations.times do snooze count += 1 end end end t0 = Time.now Fiber.current.await_all_children dt = Time.now - t0 puts "#{[fibers, iterations].inspect} setup: #{t0 - t_pre}s count: #{count} #{count / dt.to_f}/s" Thread.current.run_queue_trace end GC.disable bm(1, 1_000_000) bm(10, 100_000) bm(100, 10_000) bm(1_000, 1_000) bm(10_000, 100) # bm(100_000, 10) # bm(1_000_000, 1)
Version data entries
11 entries across 11 versions & 1 rubygems