Skip to content

RUM-6286: replacing joinToString when it possible, refactor a bit#2456

Merged
satween merged 9 commits into
developfrom
tvaleev/rum-6286/join-to-string-optimizations
Dec 18, 2024
Merged

RUM-6286: replacing joinToString when it possible, refactor a bit#2456
satween merged 9 commits into
developfrom
tvaleev/rum-6286/join-to-string-optimizations

Conversation

@satween

@satween satween commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

What does this PR do?

Here we're trying to reduce usages of joinToString method inside the project, replacing it with more performant string builder

Motivation

Using joinToString may cause a lot of memory and cpu consumption which we trying to avoid, minimizing impact of sdk to user's code

Additional Notes

Anything else we should know when reviewing?

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)

Comment thread dd-sdk-android-core/src/test/kotlin/com/datadog/android/utils/PerformanceTest.kt Outdated
Comment thread dd-sdk-android-core/src/test/kotlin/com/datadog/android/utils/PerformanceTest.kt Outdated
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from ece50e3 to 39353fd Compare December 17, 2024 12:20
@codecov-commenter

codecov-commenter commented Dec 17, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.95%. Comparing base (f9bc2b5) to head (b2a6eae).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...droid/core/internal/data/upload/CurlInterceptor.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2456      +/-   ##
===========================================
- Coverage    69.99%   69.95%   -0.04%     
===========================================
  Files          785      786       +1     
  Lines        29278    29279       +1     
  Branches      4884     4886       +2     
===========================================
- Hits         20491    20480      -11     
- Misses        7430     7441      +11     
- Partials      1357     1358       +1     
Files with missing lines Coverage Δ
.../android/error/internal/DatadogExceptionHandler.kt 87.67% <100.00%> (-0.17%) ⬇️
...datadog/android/internal/utils/StringBuilderExt.kt 100.00% <100.00%> (ø)
...g/android/rum/internal/DatadogLateCrashReporter.kt 85.88% <ø> (+1.13%) ⬆️
...dog/android/rum/internal/anr/AndroidTraceParser.kt 92.45% <100.00%> (ø)
...adog/android/rum/internal/net/RumRequestFactory.kt 69.32% <100.00%> (+3.03%) ⬆️
...droid/core/internal/data/upload/CurlInterceptor.kt 82.35% <85.71%> (-2.26%) ⬇️

... and 26 files with indirect coverage changes

@satween
satween marked this pull request as ready for review December 17, 2024 14:13
@satween
satween requested review from a team as code owners December 17, 2024 14:13
@satween
satween requested a review from xgouchet December 17, 2024 14:17
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from 77c4ba7 to b03562c Compare December 17, 2024 17:07

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left few comments/suggestions. The only blocker for me is having new extension method in the core module instead of internal.

Comment thread dd-sdk-android-core/api/apiSurface Outdated
Comment thread dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/StringBuilderExt.kt Outdated
Comment thread dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/StringBuilderExt.kt Outdated
Comment thread dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/StringBuilderExt.kt Outdated
Comment thread dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/StringBuilderExt.kt Outdated
Comment thread detekt_custom.yml Outdated
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from b03562c to 55518a7 Compare December 18, 2024 10:25
@satween
satween requested a review from 0xnm December 18, 2024 11:14
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from 92867f7 to f4159a6 Compare December 18, 2024 13:20
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from 2255594 to 2261b18 Compare December 18, 2024 14:48
@satween
satween force-pushed the tvaleev/rum-6286/join-to-string-optimizations branch from 2261b18 to b2a6eae Compare December 18, 2024 14:50
@satween
satween merged commit df15ef6 into develop Dec 18, 2024
@satween
satween deleted the tvaleev/rum-6286/join-to-string-optimizations branch December 18, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants