DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
150 stars 59 forks source link

RUM-4561 Delegate Drawable copy to background thread #2048

Closed xgouchet closed 4 months ago

xgouchet commented 4 months ago

What does this PR do?

Our previous mechanism of copying a drawable's content was performed on the main thread. When starting an app, this would create a lot of main thread task to run. And any new image would also take some of the main thread time, creating a lot of jank frames in any non hello world app.

This will fix the performance issue some of our customers started to notice when enabling SR.

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.02%. Comparing base (daec9a0) to head (efb6200).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2048 +/- ## =========================================== - Coverage 83.10% 83.02% -0.09% =========================================== Files 494 494 Lines 17720 17688 -32 Branches 2686 2684 -2 =========================================== - Hits 14726 14684 -42 - Misses 2253 2259 +6 - Partials 741 745 +4 ``` | [Files](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2048?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [...nreplay/internal/recorder/SessionReplayRecorder.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2048?src=pr&el=tree&filepath=features%2Fdd-sdk-android-session-replay%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fsessionreplay%2Finternal%2Frecorder%2FSessionReplayRecorder.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtc2Vzc2lvbi1yZXBsYXkvc3JjL21haW4va290bGluL2NvbS9kYXRhZG9nL2FuZHJvaWQvc2Vzc2lvbnJlcGxheS9pbnRlcm5hbC9yZWNvcmRlci9TZXNzaW9uUmVwbGF5UmVjb3JkZXIua3Q=) | `96.61% <100.00%> (+0.09%)` | :arrow_up: | | [...ssionreplay/internal/recorder/TreeViewTraversal.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2048?src=pr&el=tree&filepath=features%2Fdd-sdk-android-session-replay%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fsessionreplay%2Finternal%2Frecorder%2FTreeViewTraversal.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtc2Vzc2lvbi1yZXBsYXkvc3JjL21haW4va290bGluL2NvbS9kYXRhZG9nL2FuZHJvaWQvc2Vzc2lvbnJlcGxheS9pbnRlcm5hbC9yZWNvcmRlci9UcmVlVmlld1RyYXZlcnNhbC5rdA==) | `95.92% <100.00%> (+0.80%)` | :arrow_up: | | [...roid/sessionreplay/internal/utils/DrawableUtils.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2048?src=pr&el=tree&filepath=features%2Fdd-sdk-android-session-replay%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fsessionreplay%2Finternal%2Futils%2FDrawableUtils.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtc2Vzc2lvbi1yZXBsYXkvc3JjL21haW4va290bGluL2NvbS9kYXRhZG9nL2FuZHJvaWQvc2Vzc2lvbnJlcGxheS9pbnRlcm5hbC91dGlscy9EcmF3YWJsZVV0aWxzLmt0) | `93.65% <100.00%> (ø)` | | ... and [30 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2048/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)