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

Offload NDK Scope sync to background thread #3046

Closed
markushi opened this issue Nov 10, 2023 · 4 comments · Fixed by #3754
Closed

Offload NDK Scope sync to background thread #3046

markushi opened this issue Nov 10, 2023 · 4 comments · Fixed by #3754

Comments

@markushi
Copy link
Member

markushi commented Nov 10, 2023

Problem Statement

As of now any context data (user, breadcrumb, tags, ...) is synced to sentry-native on the calling thread. The calling thread might be the main thread, which is not optimal.

Solution Brainstorm

We should offload the scope sync to a background thread, ensuring we're not spending too much time on the main thread.

@markushi
Copy link
Member Author

Let's be aware if the sync happens on a background thread, the data won't be available immediately on the NDK side. E.g. when next line in code performs JNI call.

@markushi
Copy link
Member Author

Let's talk about this in the next sentry-native sync.

@markushi
Copy link
Member Author

Let's check the top-level attributes in the data bag: If it's only primitives sync the breadcrumbs directly, otherwise offload to a background thread.

@romtsn
Copy link
Member

romtsn commented Jun 5, 2024

Let's also profile/compare the timings of syncing this with only primitives. If it's quick enough we could still do that on the main thread, otherwise offload to a bg thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants