-
Notifications
You must be signed in to change notification settings - Fork 128
Description
Describe the bug
When Bugsnag is init on the App start. It tries to clear the Feature Flags here in a for loop and if you have too many Feature flags. This result in slow app launches.
We have ~200 Feature flags and 42% of slow launches in our app are happening due to this.
In concrete numbers an example
Device: iPhone 15 Pro Max
Detail: 130 ms spent in this code path during a 1121 ms launch
~11% of the total time is consumed here.
This deleting part should be moved to background thread? There could be side effects of that, new Feature flags might get added while the earlier ones are being removed. Thus causing inconsistency or other problems. But I believe those can be avoided by various other techniques.
Or other option could be to write Feature Flags in a new directory on every app init of Bugsnag while previous one is deleted in the background. Offcourse for this some state needs to be managed by SDK.
Can you please fix this at your earliest convenience. I am afraid we can not do much on our end to mitigate it except minimizing the number of FeatureFlags which is not a practical option for us right now.
Steps to reproduce
- Add 200 Feature flags
- Init Bugsnag SDK
- Measure Applaunch in total or time it takes to clear the feature flags
- It will keep growing linearly
- If you don't spot an issue, keep adding more Feature flags and the time to execute the clear Feature Flags will grow.
Environment
- BugSnag version: 6.34.0
- Xcode version: 26.0