[ruby-cvs:67208] nobu:r60027 (trunk): Release gvl while doing (f)stat

nobu at ruby-lang.org nobu at ruby-lang.org
Tue Sep 26 13:13:38 JST 2017


nobu	2017-09-26 13:13:37 +0900 (Tue, 26 Sep 2017)

  New Revision: 60027

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

  Log:
    Release gvl while doing (f)stat
    
    At the moment rb_stat function is blocking. This patch changes the
    behaviour to release the gvl while waiting for OS to return from
    f(stat).
    
    There is behaviour impact, but not significant (times are for 100000
    iterations):
    
       $ ~/releaseruby_patch/bin/ruby bench.rb
    Rehearsal ------------------------------------------------
    File.exist?:   0.036412   0.056616   0.093028 (  0.093075)
    --------------------------------------- total: 0.093028sec
    
                       user     system      total        real
    File.exist?:   0.042953   0.049783   0.092736 (  0.092804)
    
       $ ~/releaseruby_no_patch/bin/ruby bench.rb
    Rehearsal ------------------------------------------------
    File.exist?:   0.056094   0.026293   0.082387 (  0.082389)
    --------------------------------------- total: 0.082387sec
    
                       user     system      total        real
    File.exist?:   0.037250   0.046702   0.083952 (  0.083956)
    
    Based on the patch by Wolf <wolf at wolfsden.cz> at [ruby-core:83012],
    with using `rb_thread_io_blocking_region` for `fstat`.
    [Bug #13941]

  Modified files:
    trunk/common.mk
    trunk/file.c


More information about the ruby-cvs mailing list