Project

General

Profile

« Previous | Next » 

Revision 66c9d4f5

Added by nobu (Nobuyoshi Nakada) over 6 years ago

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 at [ruby-core:83012],
with using rb_thread_io_blocking_region for fstat.
[Bug #13941]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e