You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Experiment with different loading mechanisms #3161
To make users only pay for what they use, ultimately avoiding loading all generators by default, we need to experiment with different ways of loading the generators:
Lazy load
Zeitwerk
We want to run experiments to compare benchmarks and the pros and cons of each mechanism taking maintainability, fewer breaking changes, easier adoption factors as guiding points.
TBH I don't remember all the details, and perhaps it wasn't 100% done. Maybe what was not done yet was benchmarking and crafting the PR description (I mean I thought I have to explain why we need this, etc., but now I feel like I can skip that part now), but if you're interested in this patch, I'm happy to finish this.
hi @amatsuda just to let you know, we haven't forgotten about your branch. Yay for carefully crafted organic code!
I haven't had time yet to review it carefully... in the meantime, do you think it would be possible to make it an opt-in configuration? We also have revamped the benchmark suites, in case that might be helpful.
We are going to move forward with lazy loading since it allows adding external generators. The idea is to cut a beta release and let users report any bugs for the next weeks.
Activity
amatsuda commentedon Jan 29, 2026
I actually do have a branch already doing this that I created 2 years ago (carefully crafted organic code!) main...amatsuda:faker:i18n_lazy_loadable
TBH I don't remember all the details, and perhaps it wasn't 100% done. Maybe what was not done yet was benchmarking and crafting the PR description (I mean I thought I have to explain why we need this, etc., but now I feel like I can skip that part now), but if you're interested in this patch, I'm happy to finish this.
stefannibrasil commentedon Jan 30, 2026
hi @amatsuda that's awesome, thanks for sharing! We will take a look and get back to you 🚀
stefannibrasil commentedon Feb 11, 2026
hi @amatsuda just to let you know, we haven't forgotten about your branch. Yay for carefully crafted organic code!
I haven't had time yet to review it carefully... in the meantime, do you think it would be possible to make it an opt-in configuration? We also have revamped the benchmark suites, in case that might be helpful.
cc @thdaraujo
stefannibrasil commentedon Feb 18, 2026
Results for both lazy loading and autoloading (zeitwerk) are ready for discussion.
stefannibrasil commentedon Feb 19, 2026
Both results have been documented in https://github.com/faker-ruby/faker/tree/main/experiments.
Next step is to decide the solution and see how to integrate external generators so users can create their own generators.
stefannibrasil commentedon Mar 10, 2026
We are going to move forward with lazy loading since it allows adding external generators. The idea is to cut a beta release and let users report any bugs for the next weeks.
stefannibrasil commentedon Apr 14, 2026
Completed in #3228