Project

General

Profile

Actions

Feature #12973

closed

[RFC] net/http: use require_relative to reduce syscalls

Added by normalperson (Eric Wong) over 7 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
[ruby-core:78285]

Description

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.

Thoughts?

Ideally, I'd like to get all of stdlib using require_relative.
Syscall failures annoy me greatly by making strace output noisy.

This is probably more suited for the 2.5 development cycle.


Files


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #8781: Use require_relative() instead of require() if possibleClosedActions

Updated by shevegen (Robert A. Heiler) over 7 years ago

I have no particular pro or con opinion, not that it would be relevant anyway - but I am watching this closely out of interest what others have to say. :)

Updated by hsbt (Hiroshi SHIBATA) about 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to naruse (Yui NARUSE)
  • Target version set to 2.5

Updated by normalperson (Eric Wong) about 7 years ago

wrote:

https://bugs.ruby-lang.org/issues/12973

Comments? Maybe I'll commit this, soon.
Thanks.

Actions #5

Updated by shyouhei (Shyouhei Urabe) about 7 years ago

  • Related to Feature #8781: Use require_relative() instead of require() if possible added

Updated by naruse (Yui NARUSE) over 6 years ago

  • Assignee changed from naruse (Yui NARUSE) to normalperson (Eric Wong)

OK, could you commit it?

Actions #7

Updated by Anonymous over 6 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r60388.


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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0