[#104169] [Ruby master Feature#17938] Keyword alternative for boolean positional arguments — matheusrichardt@...

Issue #17938 has been reported by matheusrich (Matheus Richard).

12 messages 2021/06/04

[#104213] [Ruby master Feature#17942] Add a `initialize(public @a, private @b)` shortcut syntax for defining public/private accessors for instance vars — tyler@...

Issue #17942 has been reported by TylerRick (Tyler Rick).

6 messages 2021/06/09

[#104288] [Ruby master Bug#17992] Upstreaming the htmlentities gem into CGI#.(un)escape_html — alexandermomchilov@...

Issue #17992 has been reported by AMomchilov (Alexander Momchilov).

9 messages 2021/06/15

[#104338] [Ruby master Misc#17997] DevelopersMeeting20210715Japan — mame@...

Issue #17997 has been reported by mame (Yusuke Endoh).

10 messages 2021/06/17

[#104361] [Ruby master Bug#18000] have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library — jean.boussier@...

Issue #18000 has been reported by byroot (Jean Boussier).

9 messages 2021/06/18

[#104401] [Ruby master Feature#18007] Help developers of C extensions meet requirements in "doc/extension.rdoc" — mike.dalessio@...

Issue #18007 has been reported by mdalessio (Mike Dalessio).

16 messages 2021/06/25

[#104430] [Ruby master Bug#18011] `Method#parameters` is incorrect for forwarded arguments — josh.cheek@...

Issue #18011 has been reported by josh.cheek (Josh Cheek).

12 messages 2021/06/29

[ruby-core:104328] [Ruby master Bug#17995] Slow down when mjit and Ractor are being used at same time

From: nekoyama32767@...
Date: 2021-06-17 03:28:48 UTC
List: ruby-core #104328
Issue #17995 has been reported by nekoyama32767 (Jinsong Yu).

----------------------------------------
Bug #17995: Slow down when mjit and Ractor are being used at same time
https://bugs.ruby-lang.org/issues/17995

* Author: nekoyama32767 (Jinsong Yu)
* Status: Open
* Priority: Normal
* ruby -v: Ruby 3.0.1p64 (2021-04-05 revison 0fb782ee38)[x86-64-linux]    ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x64-mingw32]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------

When using --jit and Ractor at same time, benchmark would be slow down with recursion function such like Tarai function an Fibonacci function.
The slow down is confirmed under both gcc(linux) and mingw64(windows MSYS2).



Test environment:
Cpu:Ryzen9 5900HS@3.3Ghz 8core/16thread 
Memory:32GB@3200Mhz
OS:Ubuntu 21.04/Windows 10

Because of this cpu has 8 physic core,the parallel thread number is set to 8  

Slow down is also confirmed with using only ractor  (without sequence running).

When runing 'par' before 'seq' and using --mjit,'seq' is more slower than runing 'seq' berfore 'par'


Tarai function

def tarai(x, y, z) =
  x <= y ? y : tarai(tarai(x-1, y, z),
                     tarai(y-1, z, x),
                     tarai(z-1, x, y))
require 'benchmark'
Benchmark.bm do |x|
  # sequential version
  x.report('seq'){ 8.times{ tarai(14, 7, 0) } }

  # parallel version
  x.report('par'){
    8.times.map do
      Ractor.new { tarai(14, 7, 0) }
    end.each(&:take)
  }
end


Fibonacci function 

def fib(n)
  if n==1 then return 1 end
  if n==2 then return 1 end
  fib(n-1)+fib(n-2)
end

require 'benchmark'
Benchmark.bm do |x|
   # sequential version
  x.report('fib:seq'){ 8.times{ fib(40) } }

  # parallel version
  x.report('fib:par '){
    8.times.map do
      Ractor.new {fib(40) }
    end.each(&:take)
  }
end







-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next