Skip to content

feat(flag-evaluation): optimize ANY_OF and NOT_ANY_OFF operators#413

Merged
roncohen merged 4 commits intomainfrom
flag-evaluation-optimize-any-of-operators
Jun 4, 2025
Merged

feat(flag-evaluation): optimize ANY_OF and NOT_ANY_OFF operators#413
roncohen merged 4 commits intomainfrom
flag-evaluation-optimize-any-of-operators

Conversation

@roncohen
Copy link
Contributor

Expose a new evaluation interface which lets us optimize the ANY_OF and NOT_ANY_OFF operators. This works through the use of a one-time pre-evaluation step which converts lists used in ANY_OF and NOT_ANY_OFF evaluation to sets for quicker lookups.

@roncohen roncohen requested review from Copilot and matus-vacula May 21, 2025 19:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the evaluation of ANY_OF and NOT_ANY_OF operators by pre-processing rule filters to use sets for faster lookups.

  • Introduces a newEvaluator function that converts list values to sets for the ANY_OF and NOT_ANY_OF operators.
  • Adds corresponding tests in index.test.ts to verify the optimized evaluation logic.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/flag-evaluation/test/index.test.ts Added tests to validate the behavior of optimized rule evaluations with newEvaluator.
packages/flag-evaluation/src/index.ts Implemented a newEvaluator function and integrated set-based lookups for specific operators.

@roncohen roncohen enabled auto-merge June 4, 2025 10:41
@roncohen roncohen added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit b09adb3 Jun 4, 2025
6 checks passed
@roncohen roncohen deleted the flag-evaluation-optimize-any-of-operators branch June 4, 2025 10:50
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.

2 participants