-
Couldn't load subscription status.
- Fork 41
Description
Hello Unleash Client Team,
We have observed a significant performance and memory allocation degradation in the Unleash.Client library after upgrading from version 4.1.11 to 5.0.4. Using benchmark tests, we compared the performance of key methods (IsEnabled and GetVariant) across the two versions. Below are the details of our tests:
Steps to Reproduce
Clone the following repository for the benchmark test: [UnleashClientBenchmarkTest Github Repo]
Follow the steps in the README.md to upgrade Unleash.Client to the desired version.
Run the benchmark with:
dotnet run --configuration Release
Benchmark Results
V4.1.11
| Method | Mean | Error | StdDev | Gen0 | Allocated |
|--------------- |----------:|---------:|---------:|-------:|----------:|
| TestIsEnabled | 87.88 ns | 1.788 ns | 4.036 ns | 0.0185 | 232 B |
| TestGetVariant | 184.79 ns | 3.554 ns | 3.490 ns | 0.0253 | 320 B |
V5.0.4
| Method | Mean | Error | StdDev | Gen0 | Allocated |
|--------------- |---------:|----------:|----------:|-------:|----------:|
| TestIsEnabled | 2.931 us | 0.0585 us | 0.0928 us | 0.1678 | 2.09 KB |
| TestGetVariant | 4.950 us | 0.0976 us | 0.0913 us | 0.2899 | 3.67 KB |
-
Execution Time:
TestIsEnabled is ~33x slower in v5 (87.88 ns → 2.931 us).
TestGetVariant is ~27x slower in v5 (184.79 ns → 4.950 us). -
Memory Allocations:
TestIsEnabled allocates ~9x more memory in v5 (232 B → 2.09 KB).
TestGetVariant allocates ~11x more memory in v5 (320 B → 3.67 KB). -
Garbage Collection:
Gen0 allocations increased significantly for both methods in v5, indicating higher memory churn.
The degradation affects scenarios where IsEnabled and GetVariant are called frequently, leading to increased latency and higher memory consumption, which could significantly impact applications under high load. Therefore, we expect that the v5 implementation maintains similar performance and memory characteristics as v4, particularly for key methods like IsEnabled and GetVariant.
Thank you for investigating this issue!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status