Skip to content

RUMM-2753: Improve SDK performance a bit#1153

Merged
0xnm merged 2 commits into
feature/sdkv2from
nogorodnikov/rumm-2753/profile-sdk
Nov 23, 2022
Merged

RUMM-2753: Improve SDK performance a bit#1153
0xnm merged 2 commits into
feature/sdkv2from
nogorodnikov/rumm-2753/profile-sdk

Conversation

@0xnm

@0xnm 0xnm commented Nov 22, 2022

Copy link
Copy Markdown
Member

What does this PR do?

This change does the following:

  • Wraps OS/device info in lazy, because it shouldn't be changed during the app lifetime anyway. PUBLICATION mode is used for lazy which is using compareAndSet vs synchronisation by default (see docs for the difference), which should be a bit faster.
  • SdkCore gets time property in order to avoid pulling the whole DatadogContext when only time piece is needed. I had to implement NoOpSdkCore by hand because of that, because no-op generation doesn't support properties and anyway if it would it cannot know what default value of TimeInfo to create.
  • Usage of CoreFeature is completely removed from the SessionReplay feature.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm
0xnm requested a review from a team as a code owner November 22, 2022 17:01
@xgouchet xgouchet added the size-medium This PR is medium sized label Nov 22, 2022
@codecov-commenter

codecov-commenter commented Nov 22, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.77049% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.30%. Comparing base (76701ae) to head (105bff9).

Files with missing lines Patch % Lines
.../kotlin/com/datadog/android/v2/core/NoOpSdkCore.kt 33.33% 14 Missing ⚠️
...core/internal/system/DefaultAndroidInfoProvider.kt 90.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           feature/sdkv2    #1153      +/-   ##
=================================================
- Coverage          82.38%   82.30%   -0.08%     
=================================================
  Files                352      353       +1     
  Lines              11756    11796      +40     
  Branches            2006     2007       +1     
=================================================
+ Hits                9685     9708      +23     
- Misses              1451     1464      +13     
- Partials             620      624       +4     
Files with missing lines Coverage Δ
...oid/src/main/kotlin/com/datadog/android/Datadog.kt 71.43% <ø> (ø)
.../android/rum/internal/domain/scope/RumViewScope.kt 95.24% <100.00%> (ø)
...oid/sessionreplay/internal/SessionReplayFeature.kt 95.83% <100.00%> (-0.09%) ⬇️
...nreplay/internal/time/SessionReplayTimeProvider.kt 88.89% <100.00%> (ø)
...otlin/com/datadog/android/tracing/AndroidTracer.kt 94.03% <ø> (ø)
.../kotlin/com/datadog/android/v2/core/DatadogCore.kt 89.22% <100.00%> (+0.18%) ⬆️
...core/internal/system/DefaultAndroidInfoProvider.kt 84.91% <90.00%> (+2.30%) ⬆️
.../kotlin/com/datadog/android/v2/core/NoOpSdkCore.kt 33.33% <33.33%> (ø)

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xnm
0xnm merged commit d451d7e into feature/sdkv2 Nov 23, 2022
@0xnm
0xnm deleted the nogorodnikov/rumm-2753/profile-sdk branch November 23, 2022 13:02
@xgouchet xgouchet added this to the 1.16.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-medium This PR is medium sized

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants