Merged
Conversation
Adds configuration option to enable/disable lazy loading so it can be explicitly enabled during beta testing.
* Lazy load generators To keep this change backwards compatible, we introduce lazy loading as a config option. We need to load main classes first for nested generators such as 'music' and when lazy loading is not enabled. 'internet/http'. This will avoid the need for renaming these generators. Co-authored-by: Thiago Araujo <thd.araujo@gmail.com> * Clean up skipped generators from determinism test * Rename test file following conventions * Run lazy loading smoke test in CI * Check for true values when setting ENV['FAKER_LAZY_LOAD'] Covers the case of users setting the env using truthy values. * Better code for checking for ENV values --------- Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Faker now lazy loads the generators. It means users will only pay for what they use. Faker loads more than 2.08x faster when enabling it.: https://github.com/faker-ruby/faker/blob/main/experiments/lazy_load.md
Lazy loading the generators is disabled by default. To enable it, choose one of the configuration options below:
1 - Set lazy load as a Faker Config
Faker::Config.lazy_loading = true2 - Set lazy load as an environment variable
FAKER_LAZY_LOAD = 1We hope you get to see the improvement by enabling lazy load.
Please report any issues!