Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timbuchwaldt/fast_ensure_loaded
Speed up Code.ensure_loaded with FastGlobal caching
https://github.com/timbuchwaldt/fast_ensure_loaded
Last synced: about 2 months ago
JSON representation
Speed up Code.ensure_loaded with FastGlobal caching
- Host: GitHub
- URL: https://github.com/timbuchwaldt/fast_ensure_loaded
- Owner: timbuchwaldt
- License: mit
- Created: 2018-02-20T15:33:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T21:33:53.000Z (almost 7 years ago)
- Last Synced: 2024-10-29T08:42:32.832Z (2 months ago)
- Language: Elixir
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastEnsureLoaded
`Code.ensure_loaded/1` can become slow if you have lot's of modules (or just a few, benchmark shows that this module brings at least a ~2.5x performance increase).
We call `Code.ensure_loaded/1` only after checking a list stored in [FastGlobal](https://github.com/discordapp/fastglobal).
## Installation
The package can be installed by adding `fast_ensure_loaded` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:fast_ensure_loaded, "~> 0.1.0"}
]
end
```## Usage
Replace all calls to `Code.ensure_loaded/1` with `FastEnsureLoaded.ensure_loaded/1`
The docs can be found at [https://hexdocs.pm/fast_ensure_loaded](https://hexdocs.pm/fast_ensure_loaded).