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

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

Closed
rbalamohan opened this issue Feb 19, 2018 · 2 comments

Comments

@rbalamohan
Copy link

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.

@eli-darkly
Copy link
Contributor

See PR response. There should be a fix for this soon. Thanks for pointing it out.

@eli-darkly
Copy link
Contributor

This has been fixed in releases 2.6.1 and 3.0.2.

eli-darkly added a commit that referenced this issue Jan 14, 2019
implement dependency ordering for feature store data
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants