Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Braze.__allocating_init(configuration:) blocks main thread for 37.53ms on iPhone 12pro #111

Open
ashender opened this issue Feb 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ashender
Copy link

Platform

iOS

Platform Version

iOS 17

Braze SDK Version

6.6.0

Xcode Version

15.2

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

  1. run
    let braze = Braze(configuration: configuration)
    in the didFinishLaunching
  2. profile code with instruments

Expected Behavior

should not block or do it async

Actual Incorrect Behavior

blocks

Verbose Logs

No response

Additional Information

Can I run braze init on a background thread? this would solve issue
Screenshot 2024-02-29 at 11 03 18 am

@ashender ashender added the bug Something isn't working label Feb 29, 2024
@hokstuff
Copy link
Collaborator

Hi @ashender,

Thanks for raising this issue. Can you file an issue with support@braze.com with more context around this including:

  1. Your full initialization code around Braze
  2. Any other relevant code that runs at initialization that may take a lot of time. This includes reading data from disk, complex logic occurring at startup, etc
  3. Any other dependencies in your app which may conflict with the Braze SDK
  4. Does this happen all the time, most of the time, or occasionally? And does it occur on both the simulator + devices?
  5. Usage notes that are specific for your app such as if it is generally used in low network environments, at high altitudes, or in other high stress situations that may interfere with the device's performance
  6. Whether or not this issue is present with the most recent version of the Braze SDK

Can I run braze init on a background thread? this would solve issue

We recommend against initializing Braze on a background thread because it may lead to unexpected behavior. For instance, push notifications may not function correctly if the set up methods don't run at the start of app launch.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants