ruby-changes:53637
From: samuel <ko1@a...>
Date: Tue, 20 Nov 2018 19:52:37 +0900 (JST)
Subject: [ruby-changes:53637] samuel:r65851 (trunk): Remove `Benchmark` times.
samuel 2018-11-20 19:16:34 +0900 (Tue, 20 Nov 2018) New Revision: 65851 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65851 Log: Remove `Benchmark` times. Modified files: trunk/benchmark/vm2_fiber_chain.rb Index: benchmark/vm2_fiber_chain.rb =================================================================== --- benchmark/vm2_fiber_chain.rb (revision 65850) +++ benchmark/vm2_fiber_chain.rb (revision 65851) @@ -1,6 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_fiber_chain.rb#L1 -#!/usr/bin/env ruby - -require 'benchmark' +# Check performance of fiber creation and transfer. def make_link(previous) Fiber.new do @@ -22,24 +20,16 @@ end https://github.com/ruby/ruby/blob/trunk/benchmark/vm2_fiber_chain.rb#L20 def run_benchmark(length, repeats, message = :hello) chain = nil - - time = Benchmark.realtime do - chain = make_chain(length) do - while true - Fiber.yield(message) - end + + chain = make_chain(length) do + while true + Fiber.yield(message) end end - - puts "Creating #{fibers} fibers took #{time}..." - - time = Benchmark.realtime do - repeats.times do - abort "invalid result" unless chain.resume == message - end + + repeats.times do + abort "invalid result" unless chain.resume == message end - - puts "Passing #{repeats} messages took #{time}..." end n = (ARGV[0] || 1000).to_i -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/