Issue #15856 has been updated by deivid (David Rodr=EDguez).


I had a look at this. I manage to reproduce the issue only when requiring `=
openssl`. In general, I think it can be reproduced when a ruby feature requ=
ires an extension of the same name. In this case, `require "openssl"` resol=
ves to requiring `openssl.rb`, which internally requires among other stuff =
`openssl.so`.

To reproduce, I required openssl a lot of times, expecting that after the f=
irst time the require would have no overhead. However,


```
$ time ruby --disable-gems -e '100000.times { require "openssl" }'

real	0m3,075s
user	0m1,732s
sys     0m1,301s
```

The problem can be workaround by explicitly specifying the extension


```
$  time ruby --disable-gems -e '100000.times { require "openssl.rb" }' 2>&1

real	0m0,137s
user	0m0,113s
sys     0m0,029s
```

I took a lot at fixing it and came up with this patch

```diff
diff --git a/load.c b/load.c
index 576464fb68..ae89f63820 100644
--- a/load.c
+++ b/load.c
@@ -908,6 +908,11 @@ search_required(VALUE fname, volatile VALUE *path, int=
 safe_level, feature_func
        if (loading) *path =3D rb_filesystem_str_new_cstr(loading);
        return 'r';
     }
+    else if ((ft =3D rb_feature_p(ftptr, 0, FALSE, FALSE, &loading)) =3D=
=3D 's') {
+       if (loading) *path =3D rb_filesystem_str_new_cstr(loading);
+       return 's';
+    }
+
     tmp =3D fname;
     type =3D rb_find_file_ext_safe(&tmp, loadable_ext, safe_level);
     switch (type) {
```

However, that breaks the following spec:


```ruby
it "loads a .rb extensioned file when a C-extension file of the same name i=
s loaded" do
  $LOADED_FEATURES << File.expand_path("load_fixture.bundle", CODE_LOADING_=
DIR)
  $LOADED_FEATURES << File.expand_path("load_fixture.dylib", CODE_LOADING_D=
IR)
  $LOADED_FEATURES << File.expand_path("load_fixture.so", CODE_LOADING_DIR)
  $LOADED_FEATURES << File.expand_path("load_fixture.dll", CODE_LOADING_DIR)
  path =3D File.expand_path "load_fixture", CODE_LOADING_DIR
  @object.require(path).should be_true
  ScratchPad.recorded.should =3D=3D [:loaded]
end

```

I'm not sure that spec is expected behavior, though. It was introduced duri=
ng [this refactoring](https://github.com/ruby/spec/commit/3f03b2989b9bc6d92=
c4c60989d0cafe604d20d50), but I think the refactoring changed the expectati=
ons, because the previous spec I think this spec comes from reads like this:


```ruby
it "will load file.rb when given 'file' if it exists even if file.<ext> is =
loaded" do
  $LOADED_FEATURES << "require_spec_3.#{Config::CONFIG['DLEXT']}"
  require('require_spec_3.rb').should be_true
  $LOADED_FEATURES.grep(/require_spec_3\.rb/).should_not =3D=3D []
end
```

and while the description is what the spec tests nowadays, the implementati=
on explictly included an extension, while the current spec does not.


Essentially I think it comes down to whether the correct behavior is the cu=
rrent one:


```
irb(main):001:0> require 'openssl.so'
=3D> true
irb(main):002:0> require 'openssl'
=3D> true
irb(main):003:0> =


```

or the one after my patch:


```
irb(main):001:0> require 'openssl.so'
=3D> true
irb(main):002:0> require 'openssl'
=3D> false

```

If the expected behavior is the current one, then obviously my patch doesn'=
t work.

----------------------------------------
Bug #15856: Idempotent performance of Kernel.require with many activated ge=
ms is slow
https://bugs.ruby-lang.org/issues/15856#change-78092

* Author: lamont (Lamont Granquist)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version: =

* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
With many activated gems the performance of Kernel.require (aka Kernel.gem_=
original_require after rubygems is loaded) is very slow, even in the case w=
here the require has already been loaded (the idempotent case).

What it looks like is happening is every time it needs to resolve the strin=
g argument to a pathname in order to compare against a cache of already loa=
ded paths.  Since require and require_relative need to be able to share sta=
te this makes sense to do, but this becomes very expensive with lots of act=
ivated gems, particularly on windows (where open/stat on windows is 10x mor=
e expensive than on linux).

What probably needs to happen is that for require (but not require_relative=
 which is already fairly fast) there needs to a be another layer of idempot=
ency checking that happens which compares only the string argument in a Has=
h to see if the key exists or not (which I believe is likely the old way th=
at require used to work before require_relative was introduced).  That mean=
s that on the second time a require line was processed it would find that v=
alue was true and would short circuit without doing any File I/O to resolve=
 the filename.  Of course the first time it still would need to do the chec=
k resolve to the full path and still maintain that cache so that require an=
d require_relative were still idempotent between them.

After doing some testing I don't think this would introduce any user-visibl=
e behavior changes, since requires lines should always be idempotent.  I th=
ought it would fix some actual bugs in behavior but I was unable to "trick"=
 the existing loader into double-loading a requires line even though I trie=
d installing and activating gems after having already required system libs.=
  Since I couldn't find any bugs, though, that also means that this should =
be backwards compatible with existing behavior.

An strace of the process of a single `require "openssl"`, after it has been=
 already required looks like this:

open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/uuidtools-2.1.5/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-bin-15.0.276/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/public_suffix-3.0.3/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/addressable-2.6.0/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-shellout-2.4.4/lib=
/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or=
 directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-cli-2.0.3/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/appbundler-0.12.5/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/bcrypt_pbkdf-1.0.1/lib/op=
enssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or di=
rectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
bcrypt_pbkdf-1.0.1/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOEN=
T (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/debug_inspector-0.0.3/lib=
/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or=
 directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
debug_inspector-0.0.3/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 EN=
OENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/binding_of_caller-0.8.0/l=
ib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file =
or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
binding_of_caller-0.8.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 =
ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/builder-3.2.3/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/byebug-11.0.1/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
byebug-11.0.1/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No=
 such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tomlrb-1.2.8/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-config-3.0.1/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/fuzzyurl-0.9.0/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.0.276/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/net-ssh-5.2.0/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/net-scp-2.0.0/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/erubis-2.7.0/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ffi-1.10.0/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
ffi-1.10.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No su=
ch file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/gssapi-1.3.0/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/gyoku-1.3.1/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/httpclient-2.8.3/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/little-plugger-1.1.4/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/multi_json-1.13.1/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/logging-2.2.2/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/nori-2.6.0/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rubyntlm-0.6.2/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/winrm-2.3.2/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rubyzip-1.2.2/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/winrm-fs-1.3.2/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/train-core-2.1.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/equatable-0.5.0/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-color-0.4.3/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/pastel-0.7.2/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-cursor-0.6.1/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/strings-ansi-0.1.0/lib/op=
enssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or di=
rectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/unicode_utils-1.4.0/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/unicode-display_width-1.4=
.1/lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such f=
ile or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/strings-0.1.4/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-box-0.3.0/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/necromancer-0.4.0/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/timers-4.3.0/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/wisper-2.0.0/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-screen-0.6.5/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-reader-0.5.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-prompt-0.18.1/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/license-acceptance-1.0.5/=
lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file=
 or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-log-3.0.1/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-authentication-2.1=
.1/lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such f=
ile or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/mixlib-archive-1.0.1/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/systemu-2.6.5/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/libyajl2-1.2.0/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
libyajl2-1.2.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (N=
o such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ffi-yajl-2.3.1/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
ffi-yajl-2.3.1/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (N=
o such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/plist-3.5.0/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ipaddress-0.8.3/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/wmi-lite-1.0.2/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ohai-15.0.34/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/net-ssh-gateway-2.0.0/lib=
/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or=
 directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/net-ssh-multi-1.2.1/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/net-sftp-2.1.2/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ed25519-1.2.4/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
ed25519-1.2.4/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No=
 such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/highline-1.7.10/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/diff-lcs-1.3/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ffi-libarchive-0.4.6/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/hashie-3.6.0/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/uuidtools-2.1.5/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rack-2.0.7/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-zero-14.0.12/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/iniparse-1.4.4/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/syslog-logger-1.6.8/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/proxifier-1.0.3/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.0.276/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-bin-15.0.276/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-vault-3.4.3/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/cheffish-14.0.4/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/coderay-1.1.2/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/safe_yaml-1.0.5/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/crack-0.4.3/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/docile-1.3.1/lib/openssl.=
rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or director=
y)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/multipart-post-2.0.0/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/faraday-0.15.4/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/faraday_middleware-0.12.2=
/lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such fil=
e or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/hashdiff-0.3.9/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/htmlentities-4.3.4/lib/op=
enssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or di=
rectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/method_source-0.9.2/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-support-3.8.0/lib/o=
penssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or d=
irectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-expectations-3.8.3/=
lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file=
 or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-mocks-3.8.0/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-3.8.0/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec-its-1.3.0/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/pry-0.12.2/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/sslshake-1.3.0/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/parallel-1.17.0/lib/opens=
sl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direc=
tory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/parslet-1.8.2/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/semverse-3.0.0/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tty-table-0.10.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/tins-1.20.2/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/term-ansicolor-1.7.1/lib/=
openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or =
directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.3.2/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/json-2.2.0/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
json-2.2.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No su=
ch file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/pry-byebug-3.7.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/slop-3.6.0/lib/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/pry-remote-0.1.8/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/pry-stack_explorer-0.4.9.=
3/lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such fi=
le or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/openssl.r=
b", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rb-readline-0.5.5/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/rspec_junit_formatter-0.2=
.3/lib/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such f=
ile or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ruby-prof-0.17.0/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
ruby-prof-0.17.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT =
(No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ruby-shadow-2.5.0/lib/ope=
nssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dir=
ectory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/=
ruby-shadow-2.5.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT=
 (No such file or directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/simplecov-html-0.10.2/lib=
/openssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or=
 directory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/simplecov-0.16.1/lib/open=
ssl.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or dire=
ctory)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/webmock-3.5.1/lib/openssl=
.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directo=
ry)
open("/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/openss=
l.rb", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct=
ory)
open("/opt/chef/embedded/lib/ruby/site_ruby/2.6.0/openssl.rb", O_RDONLY|O_N=
ONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/site_ruby/2.6.0/x86_64-linux/openssl.rb",=
 O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/site_ruby/openssl.rb", O_RDONLY|O_NONBLOC=
K|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/vendor_ruby/2.6.0/openssl.rb", O_RDONLY|O=
_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/vendor_ruby/2.6.0/x86_64-linux/openssl.rb=
", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/vendor_ruby/openssl.rb", O_RDONLY|O_NONBL=
OCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
open("/opt/chef/embedded/lib/ruby/2.6.0/openssl.rb", O_RDONLY|O_NONBLOCK|O_=
CLOEXEC) =3D 7

On windows, taking this much I/O on every single require line, can quickly =
add up to 100,000s of open calls, which takes several seconds on an SSD and=
 can take upwards of a minute on a spinning drive just to evaluate the requ=
ires of an application that does no work (i.e. command line tooling).



-- =

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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>