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

SentryLogcatAdaptor consumes unnecessary time on main thread #3430

Closed
kozaxinan opened this issue May 17, 2024 · 3 comments
Closed

SentryLogcatAdaptor consumes unnecessary time on main thread #3430

kozaxinan opened this issue May 17, 2024 · 3 comments
Labels
Platform: Android Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working

Comments

@kozaxinan
Copy link

kozaxinan commented May 17, 2024

Integration

sentry-android

Build System

Gradle

AGP Version

8.4.0

Proguard

Enabled

Version

7.8.0

Steps to Reproduce

Log a warning or error.
SentryLogcatAdapter calls addAsBreadcrumb.

Expected Result

It should not take more time than calling log without Sentry.

Actual Result

Gson operations takes a more than 3ms for every log operation.
That quickly aggregates for an app that has lots of log calls.

Screenshot 2024-05-17 at 15 16 19

cpu-art-20240517T150036.trace.zip

┆Issue is synchronized with this Jira Improvement by Unito

@kozaxinan
Copy link
Author

I come up with following solution.
I wonder if it would be better to disable NDK sync.

 val ndkScope = scopeObservers.firstOrNull { it is NdkScopeObserver }

                scopeObservers.apply {
                    remove(ndkScope)
                }

                if (ndkScope != null) {
                    addScopeObserver(
                        object : IScopeObserver by ndkScope {

                            override fun addBreadcrumb(crumb: Breadcrumb) {
                                coroutineScope.launch {
                                    ndkScope.addBreadcrumb(crumb)
                                }
                            }
                        }
                    )
                }

@stefanosiano
Copy link
Member

stefanosiano commented May 22, 2024

hi @kozaxinan, thanks for the report!
We'll have a look at it soon!
Probably related to #3046

@Angelodaniel Angelodaniel added the Sync: Jira apply to auto-create a Jira shadow ticket label May 28, 2024
@romtsn
Copy link
Member

romtsn commented Jun 5, 2024

@kozaxinan we're going to close this as a duplicate of #3046, and reprioritize that one to tackle it sooner. Thanks for investigating this and providing us with data, please track it in the other issue 🙏

@romtsn romtsn closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working
Projects
Archived in project
Status: Done
Development

No branches or pull requests

5 participants