[前][次][番号順一覧][スレッド一覧]

ruby-changes:46487

From: normal <ko1@a...>
Date: Mon, 8 May 2017 10:59:17 +0900 (JST)
Subject: [ruby-changes:46487] normal:r58606 (trunk): benchmark/bm_vm2_fiber_switch.rb: check for fiber performance

normal	2017-05-08 10:59:12 +0900 (Mon, 08 May 2017)

  New Revision: 58606

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58606

  Log:
    benchmark/bm_vm2_fiber_switch.rb: check for fiber performance
    
    There are currently no benchmarks for Fiber performance, I
    should've committed this years ago when [Feature #10341] was
    implemented.

  Added files:
    trunk/benchmark/bm_vm2_fiber_switch.rb
Index: benchmark/bm_vm2_fiber_switch.rb
===================================================================
--- benchmark/bm_vm2_fiber_switch.rb	(nonexistent)
+++ benchmark/bm_vm2_fiber_switch.rb	(revision 58606)
@@ -0,0 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_fiber_switch.rb#L1
+# based on benchmark for [ruby-core:65518] [Feature #10341] by Knut Franke
+fib = Fiber.new do
+  loop { Fiber.yield }
+end
+i = 0
+while i< 6_000_000 # benchmark loop 2
+  i += 1
+  fib.resume
+end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]