Conversation

aliu39

Follow up on #16485 (review)

Instead of tracking the evaluated feature flags in a global weakmap, we can directly check the span attributes by converting to JSON.

@aliu39aliu39 marked this pull request as ready for review June 18, 2025 21:58
@aliu39aliu39 requested review from chargome, a team and AbhiPrasad and removed request for a team June 18, 2025 21:58
@aliu39

@chargome I'm curious if the team has concerns on performance? If a customer is repeatedly evaluating 100s of flags and calling addFeatureFlag each time, should we worry about spanToJSON being too expensive?

Choose a reason for hiding this comment

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

We previously did have some issues with spanToJSON - but the performance should be much better now.

Might be nice to benchmark - you can probably test server-side with profiling a node app: https://nodejs.org/en/learn/getting-started/profiling

@aliu39

Talked with @AbhiPrasad , closing for now until I get more bandwidth to play with benchmarking experiments. The map implementation should be fine for releasing

@aliu39aliu39 closed this Jun 18, 2025
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.