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

address scaling issues #21

Open
kaworu opened this issue Feb 1, 2022 · 0 comments
Open

address scaling issues #21

kaworu opened this issue Feb 1, 2022 · 0 comments
Labels
enhancement New feature or request module/flow Affects the flow module module/main Affects the main module

Comments

@kaworu
Copy link
Member

kaworu commented Feb 1, 2022

Problem description

Currently, fake is using Go's math/rand global methods as PRNG. The global rand methods uses the single (private) globalRand generator which is based on a locked source. This approach doesn't allow multiple goroutine to use fake in a way that scales, because we end up with lock contention on globalRand's RNG source.

Proposed solution

To address this issue, fake could expose an API allowing instantiation of fake generators, e.g.

f := fake.New()
flow := f.Flow()

Each instance would have their own independent PRNG instance. Of course, this would be in addition to the current global API which is more convenient when concurrency is not needed.

@kaworu kaworu added enhancement New feature or request module/main Affects the main module module/flow Affects the flow module labels Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module/flow Affects the flow module module/main Affects the main module
Projects
None yet
Development

No branches or pull requests

1 participant