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
File.exist?: 0.037250 0.046702 0.083952 ( 0.083956)
Based on the patch by Wolf wolf@wolfsden.cz at [ruby-core:83012], with using rb_thread_io_blocking_region for fstat. [Bug #13941]
rb_thread_io_blocking_region
fstat
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
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
File.exist?: 0.037250 0.046702 0.083952 ( 0.083956)
Based on the patch by Wolf wolf@wolfsden.cz at [ruby-core:83012],
with using
rb_thread_io_blocking_region
forfstat
.[Bug #13941]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e