Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Lazy Autoloading to Speed Up Boot Time for Sorcery #348

Open
jonmchan opened this issue Aug 29, 2023 · 1 comment
Open

Implement Lazy Autoloading to Speed Up Boot Time for Sorcery #348

jonmchan opened this issue Aug 29, 2023 · 1 comment
Labels
implemented in v1 This issue or pull request has been resolved in the v1 rework codebase

Comments

@jonmchan
Copy link

Configuration

  • Sorcery Version: 0.16.5
  • Ruby Version: 3.1.2
  • Framework: Rails 6.1.6
  • Platform: MacOS

Sorcery does not have any lazy loading - everything is always loaded when the gem is included, including test helpers, submodules that may or may not be used, and protocols that is not necessary.

If we take a look at the load times using a tool like bumbler (gem install bumbler bumbler --all), we see that sorcery takes almost as long to load as rails:

 $ bumbler --all
...
    844.13  sorcery
    922.26  rails

I believe load times can be improved if we consider using autoloading like zeitwerk.

@joshbuker joshbuker added the implemented in v1 This issue or pull request has been resolved in the v1 rework codebase label Sep 15, 2023
@joshbuker
Copy link
Member

Yup, also run into other issues due to the way it forcibly requires everything. v1 rework uses zeitwerk, but is still waiting on completion (I have so little time it's not even funny 🙃 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented in v1 This issue or pull request has been resolved in the v1 rework codebase
Projects
None yet
Development

No branches or pull requests

2 participants