Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPLAY-1890: Implement pool of reusable bitmaps #1554

Merged

Conversation

jonathanmos
Copy link
Member

What does this PR do?

Adds a reusable bitmap pool for base64.

Motivation

Reduce the number of new bitmaps created.

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)

@jonathanmos jonathanmos force-pushed the jmoskovich/replay-1890/bitmap-pool branch from bd8e3f1 to f703ef9 Compare July 25, 2023 07:37
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2023

Codecov Report

Merging #1554 (227afe9) into feature/base64-jmoskovich (dcd6805) will decrease coverage by 0.30%.
The diff coverage is 65.65%.

❗ Current head 227afe9 differs from pull request most recent head 8002635. Consider uploading reports for the commit 8002635 to get more accurate results

@@                      Coverage Diff                      @@
##           feature/base64-jmoskovich    #1554      +/-   ##
=============================================================
- Coverage                      83.63%   83.32%   -0.30%     
=============================================================
  Files                            439      443       +4     
  Lines                          14977    15070      +93     
  Branches                        2258     2272      +14     
=============================================================
+ Hits                           12525    12557      +32     
- Misses                          1879     1923      +44     
- Partials                         573      590      +17     
Files Changed Coverage Δ
...nreplay/internal/async/RecordedDataQueueHandler.kt 88.52% <ø> (-0.87%) ⬇️
...ndroid/sessionreplay/internal/utils/Base64Utils.kt 66.67% <0.00%> (ø)
...android/sessionreplay/internal/utils/CacheUtils.kt 0.00% <0.00%> (ø)
...id/sessionreplay/internal/recorder/base64/Cache.kt 25.00% <25.00%> (ø)
...nreplay/internal/recorder/base64/Base64LRUCache.kt 84.85% <33.33%> (+13.42%) ⬆️
...ssionreplay/internal/recorder/base64/BitmapPool.kt 61.97% <61.97%> (ø)
...roid/sessionreplay/internal/utils/DrawableUtils.kt 96.97% <92.86%> (-3.03%) ⬇️
...eplay/internal/recorder/base64/Base64Serializer.kt 88.73% <100.00%> (+0.85%) ⬆️
...y/internal/recorder/base64/WebPImageCompression.kt 90.00% <100.00%> (ø)
...id/sessionreplay/internal/utils/InvocationUtils.kt 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

Copy link
Member

@mariusc83 mariusc83 left a comment

Choose a reason for hiding this comment

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

I like the idea of backing up the BitmapPool with an LruCache. There are still things to address in here but the idea works.

@jonathanmos jonathanmos force-pushed the jmoskovich/replay-1890/bitmap-pool branch 3 times, most recently from ab97424 to ba3545f Compare July 31, 2023 07:46
@jonathanmos jonathanmos force-pushed the jmoskovich/replay-1890/bitmap-pool branch 2 times, most recently from 080e566 to c0a9969 Compare July 31, 2023 10:30
@jonathanmos jonathanmos marked this pull request as ready for review July 31, 2023 11:00
@jonathanmos jonathanmos requested a review from a team as a code owner July 31, 2023 11:00
mariusc83
mariusc83 previously approved these changes Aug 8, 2023
features/dd-sdk-android-session-replay/build.gradle.kts Outdated Show resolved Hide resolved
@jonathanmos jonathanmos force-pushed the jmoskovich/replay-1890/bitmap-pool branch from 227afe9 to 8002635 Compare August 9, 2023 09:27
@jonathanmos jonathanmos merged commit f1c9ce2 into feature/base64-jmoskovich Aug 9, 2023
@jonathanmos jonathanmos deleted the jmoskovich/replay-1890/bitmap-pool branch August 9, 2023 10:13
@xgouchet xgouchet added this to the 2.2.0 milestone Dec 13, 2023
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