Skip to content

Preprocess middleware experiments #1

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xetorthio
Copy link

Instead of always go through all experiments for every request to pick one based on the random number. We preprocess the experiments when the middleware is created and create an array where experiments are distributed based on their weight. Then the way to pick an experiment is just getting a random number and accessing the array by index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant