[ruby-cvs:67569] normal:r60388 (trunk): net/http: use require_relative to reduce syscalls

normal at ruby-lang.org normal at ruby-lang.org
Tue Oct 24 10:22:08 JST 2017


normal	2017-10-24 10:22:08 +0900 (Tue, 24 Oct 2017)

  New Revision: 60388

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

  Log:
    net/http: use require_relative to reduce syscalls
    
    require_relative speeds up loading of files by reducing path
    lookups.  On a clean install with RubyGems-enabled,
    "ruby -rnet/http -e exit" shows a reduction in failed open(2)
    syscalls from 410 to 350 (x86-64 GNU/Linux).
    
    I could not measure a time difference on my Linux-based
    machines, however this should be noticeable to users of other
    kernels with worse syscall and VFS performance than Linux.
    
    Further use of require_relative will reduce lookups in other
    places.
    
    * lib/net/http.rb: use require_relative
      [ruby-core:78285] [Feature #12973]

  Modified files:
    trunk/lib/net/http.rb


More information about the ruby-cvs mailing list