Skip to content

Commit

Permalink
Merge pull request rails#50902 from rails/docs/add_autoload_paths_to_…
Browse files Browse the repository at this point in the history
…load_path

Remove add_autoload_paths_to_load_path docs from autoloading guide
  • Loading branch information
fxn authored Jan 28, 2024
2 parents 56fd69e + d823faa commit cf26c54
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions guides/source/autoloading_and_reloading_constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,6 @@ module MyApp
end
```

$LOAD_PATH{#load_path}
----------

Autoload paths are added to `$LOAD_PATH` by default. However, Zeitwerk uses absolute file names internally, and your application should not issue `require` calls for autoloadable files, so those directories are actually not needed there. You can opt out with this flag:

```ruby
config.add_autoload_paths_to_load_path = false
```

That may speed up legitimate `require` calls a bit since there are fewer lookups. Also, if your application uses [Bootsnap](https://github.com/Shopify/bootsnap), that saves the library from building unnecessary indexes, leading to lower memory usage.

The `lib` directory is not affected by this flag, it is added to `$LOAD_PATH` always.

Reloading
---------

Expand Down

0 comments on commit cf26c54

Please sign in to comment.