growthbook / growthbook-sdk-java

The Java SDK for GrowthBook (JVM, Android)
https://docs.growthbook.io/lib/java
MIT License
7 stars 10 forks source link

Spend less time generating `MalformedUrlException` #34

Closed crinklywrappr closed 11 months ago

crinklywrappr commented 11 months ago

Goal

To increase performance of evalFeature.

Summary

Profiling our application revealed that growthbook spent a lot of time in the URL constructor when evalFeature was called.

Steps to reproduce

In our application, we set featuresJson on the GBContext builder and leave the URL unset.

Repeated calls to evalFeature results in a noticeable amount of time spent in the URL constructor @ GrowthBookUtils/getQueryStringOverride.

Resolution

Growthbook should check if urlString is null or empty before entering the try/catch block in GrowthBookUtils/getQueryStringOverride.