Skip to content

Experiment with different loading mechanisms #3161

Closed
4 of 4 issues completed
Closed

Description

@stefannibrasil

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.

Activity

  1. amatsuda commented on Jan 29, 2026

    @amatsuda
    Contributor

    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.

  2. stefannibrasil commented on Jan 30, 2026

    @stefannibrasil
    ContributorAuthor

    hi @amatsuda that's awesome, thanks for sharing! We will take a look and get back to you 🚀

  3. stefannibrasil commented on Feb 11, 2026

    @stefannibrasil
    ContributorAuthor

    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

  4. stefannibrasil commented on Feb 18, 2026

    @stefannibrasil
    ContributorAuthor

    Results for both lazy loading and autoloading (zeitwerk) are ready for discussion.

  5. stefannibrasil commented on Feb 19, 2026

    @stefannibrasil
    ContributorAuthor

    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.

  6. stefannibrasil commented on Mar 10, 2026

    @stefannibrasil
    ContributorAuthor

    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.

  7. stefannibrasil commented on Apr 14, 2026

    @stefannibrasil
    ContributorAuthor

    Completed in #3228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions