diff options
| author | nagachika <nagachika@ruby-lang.org> | 2025-03-08 17:26:28 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2025-03-08 17:26:28 +0900 |
| commit | 54dd27d89d2e6814114f1aff18836a987d5a4ab1 (patch) | |
| tree | 3d37cf6965fd4153dd0174b490b208dc658de8f2 /include/ruby/ruby.h | |
| parent | 8274b8193e0a047d1edfff603dd2436276f906c4 (diff) | |
merge revision(s) d4a1a2780c39bc648496ac92fc6e6ce2eb38ab47: [Backport #21032]
rb_feature_p: skip `get_expanded_load_path` for absolute paths
Ref: https://github.com/fxn/zeitwerk/pull/308
```ruby
require 'benchmark'
$LOAD_PATH << 'relative-path'
autoload :FOO, '/tmp/foo.rb'
puts Benchmark.realtime {
500_000.times do
Object.autoload?(:FOO)
end
}
```
The above script takes 2.5 seconds on `master`, and only
50ms on this branch.
When we're looking for a feature with an absolute path, we don't
need to call the expensive `get_expanded_load_path`.
Diffstat (limited to 'include/ruby/ruby.h')
0 files changed, 0 insertions, 0 deletions
