[ruby-cvs:67292] normal:r60111 (trunk): Dir.empty? releases GVL

normal at ruby-lang.org normal at ruby-lang.org
Wed Oct 4 09:04:51 JST 2017

normal	2017-10-04 09:04:51 +0900 (Wed, 04 Oct 2017)

  New Revision: 60111


    Dir.empty? releases GVL
    This converts all slow syscalls in the Dir.empty? implementation
    to release GVL.  We avoid unnecessarily GVL release and
    reacquire for each slow call (opendir, readdir, closedir) and
    instead only release and acquire the GVL once in the common
    Benchmark results show a small degradation in single-threaded
    Execution time (sec)
    name	trunk	built
    dir_empty_p	0.689	0.758
    Speedup ratio: compare with the result of `trunk' (greater is better)
    name	built
    dir_empty_p	0.909
    * dir.c (rb_gc_for_fd_with_gvl): new function
      (nogvl_dir_empty_p): ditto
      (dir_s_empty_p): use new functions to release GVL
    * benchmark/bm_dir_empty_p.rb: new benchmark
      [ruby-core:83071] [Feature #13958]

  Added files:
  Modified files:

More information about the ruby-cvs mailing list