Skip to content

Conversation

@tomgasson
Copy link

@tomgasson tomgasson commented Sep 3, 2024

I noticed that this implementation is always computing the per-rule hash. Most targetting cases are either including or excluding all users which pass the condition.

Shortcutting these always pass / always fail cases will substantially reduce the number of string concatenation and hashing operations performed in this hot loop of rule evaluation.

Some other clients already have this optimisation:
https://github.com/statsig-io/js-client-monorepo/blob/main/packages/js-on-device-eval-client/src/Evaluator.ts#L427-L433

PR to do the same to the node-js-server-sdk statsig-io/node-js-server-sdk#51

This reduces the number of hashing operations performed substantially
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