Skip to content

Conversation

@jnunemaker
Copy link
Collaborator

Before:

[user, team, org].any? { |actor| Flipper.enabled?(:some_feature, actor) }

After:

Flipper.enabled?(:some_feature, [user, team, org])

The biggest benefit is not re-running all the gates and instrumentation for every actor and every gate. Instead this runs the boolean and & of time once. Then it just checks multiple actors in the actor, % of actors and group gates.

I'm going to give this another pass to see if anything needs to change back or not.

@jnunemaker jnunemaker self-assigned this Mar 19, 2023
@jnunemaker
Copy link
Collaborator Author

Forgot to drop here that checking 5 actors at once vs 5 enabled checks with 1 actor each is like 5x faster so that's good!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants