getsentry / team-mobile

Meta issues for the Mobile team
4 stars 1 forks source link

DB on the main thread #102

Closed kahest closed 1 year ago

kahest commented 1 year ago

Performing DB queries on the main thread can lead to performance issues. To enable a performance issue detector on the backend to detect such queries, extend existing DB instrumentation to report whether the query was executed on the main thread.

### iOS Integrations
- [ ] https://github.com/getsentry/sentry-cocoa/issues/2873
### Android integrations - SQLite
- [ ] https://github.com/getsentry/sentry-android-gradle-plugin/issues/401
- [ ] https://github.com/getsentry/sentry-java/pull/2722
- [ ] https://github.com/getsentry/sentry-android-gradle-plugin/pull/502
- [ ] https://github.com/getsentry/sentry-docs/pull/7113
romtsn commented 1 year ago

FYI for Room it doesn't make sense to implement this, as they have their own checks if the app is calling the database on the main thread, and they throw an exception if that's the case. So I crossed it out

kahest commented 1 year ago

After https://github.com/getsentry/sentry-android-gradle-plugin/issues/401 is solved via https://github.com/getsentry/sentry-java/pull/2722, DB on the main thread: SQLite can be implemented

vipulm7 commented 1 year ago

You may use Executor Service to perform DB queries on the background thread.