From 20f1c6c185f63cc4fcc1e27bf947dc1d734327d9 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 20 Nov 2018 10:16:34 +0000 Subject: [PATCH] Remove `Benchmark` times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/vm2_fiber_chain.rb | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/benchmark/vm2_fiber_chain.rb b/benchmark/vm2_fiber_chain.rb index 7d5b561229..bd00e8a659 100755 --- a/benchmark/vm2_fiber_chain.rb +++ b/benchmark/vm2_fiber_chain.rb @@ -1,6 +1,4 @@ -#!/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 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