Sorcery / sorcery

Magical Authentication
https://rubygems.org/gems/sorcery
MIT License
1.45k stars 228 forks source link

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

Open jonmchan opened 1 year ago

jonmchan commented 1 year ago

Configuration

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 commented 1 year ago

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 :upside_down_face: )