Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Consider improving LDUser::getValueForEvaluation performance for custom attributes #113

@rbalamohan

Description

@rbalamohan

For custom attributes, currently {{LDUSer::getValueForEvaluation}} checks for {{UserAttribute}} first and moves on to check "custom" attributes.

https://github.com/launchdarkly/java-client/blob/8b29441d5870ecc8b20d31d0b2fff2c5a32007de/src/main/java/com/launchdarkly/client/LDUser.java#L73

https://github.com/launchdarkly/java-client/blob/8b29441d5870ecc8b20d31d0b2fff2c5a32007de/src/main/java/com/launchdarkly/client/LDUser.java#L77

As a part of this, it always encounters "IllegalArguementException" which ends up populating the entire stacktrace (which could be 100s in size). This turns out to be very expensive depending on the number of calls.

It would be good consider, where custom attributes are checked first and then check the user attribute. This way, we do not need to pay the penalty of filling up the stack trace for every call involving custom attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions