[ruby-cvs:67269] normal:r60088 (trunk): File#rename releases GVL

normal at ruby-lang.org normal at ruby-lang.org
Mon Oct 2 06:19:24 JST 2017


normal	2017-10-02 06:19:24 +0900 (Mon, 02 Oct 2017)

  New Revision: 60088

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

  Log:
    File#rename releases GVL
    
    rename(2) requires two pathname resolution operations which can
    take considerable time on slow filesystems, release the GVL so
    operations on other threads may proceed.
    
    On fast, local filesystems, this change results in some slowdown
    as shown by the new benchmark.  I consider the performance trade
    off acceptable as cases are avoided.
    
    benchmark results:
    minimum results in each 3 measurements.
    Execution time (sec)
    name	trunk	built
    file_rename	2.648	2.804
    
    Speedup ratio: compare with the result of `trunk' (greater is better)
    name	built
    file_rename	0.944
    
    * file.c (no_gvl_rename): new function
      (rb_file_s_rename): release GVL for renames
    * benchmark/bm_file_rename.rb: new benchmark

  Added files:
    trunk/benchmark/bm_file_rename.rb
  Modified files:
    trunk/file.c


More information about the ruby-cvs mailing list