Closed lemnik closed 3 months ago
Format | Size impact of Bugsnag (kB) | Size impact of Bugsnag when Minified (kB) |
---|---|---|
APK | 1851.58 | 1674.82 |
arm64_v8a | 631.04 | 450.82 |
armeabi_v7a | 565.51 | 385.29 |
x86 | 704.75 | 528.62 |
x86_64 | 676.09 | 495.86 |
Generated by :no_entry_sign: Danger
Goal
Avoid blocking the main thread during normal startups.
Design
Previously in order to avoid [StrictMode]() violations the notifier would run most IO related work on a background thread. However these background tasks would be immediately awaited by the
main
thread, which has the side-effect of blocking the main thread anyway.This PR changes all of the "results" objects into
Future
s such that the main thread will continue processing until the background task result is actually required. There are severalStrictMode
violations remaining, most of which are from retrieving theContext.filesDir
andcacheDir
(both of whichstat
on the main thread). These will be corrected in a future PR into this integration branch which will improve the use of background tasks further.Changeset
Replaced all of the background task results with
Future
objects, so that each can be awaited when it is required.Testing
Modified existing unit tests to handle the new startup sequence.