Skip to content

feat: Moves compression before buffer (Optimization)#144

Merged
abelonogov-ld merged 24 commits intomainfrom
andrey/exportdiffmanager
Mar 5, 2026
Merged

feat: Moves compression before buffer (Optimization)#144
abelonogov-ld merged 24 commits intomainfrom
andrey/exportdiffmanager

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented Mar 4, 2026

Matching Android in File Structure


Note

Medium Risk
Touches core capture/compression and rrweb event generation logic, so regressions could impact replay fidelity or payload size; changes are reasonably scoped and backed by new targeted tests and a benchmark harness.

Overview
Refactors the session replay pipeline so screen capture now produces ExportFrame diffs via a new ExportDiffManager (tracking addImages/removeImages and keyFrameId) instead of exporting from a TiledFrame inline, enabling optional tile backtracking via a new CompressionMethod.overlayTiles(layers:backtracking:) option.

Updates RRWeb event generation to emit DOM mutations based on these add/remove commands, track known keyframes (dropping frames that can’t be reconstructed), and slightly lowers the canvas buffer threshold; related payload costing/stats, session exporter session-update handling, and RRWeb type visibility are adjusted accordingly.

Adds a UIKit-only benchmark harness (raw frame CSV/PNG IO, benchmark executor, sample Mastodon walk data, and a TestApp Benchmark UI) and expands unit tests to cover keyframe/buffer-limit behavior and backtracking rollbacks.

Written by Cursor Bugbot for commit c67581b. This will update automatically on new commits. Configure here.

(cherry picked from commit 78ad485)
…anvas buffer limit. Updated makeExportFrame to accept keyFrameId and isKeyframe parameters. Adjusted canvasBufferLimit to account for keyframe logic. Added test to verify mutation appending when canvas buffer limit is exceeded for non-keyframes.
- Added support for command-line options including scheme, destination, only-testing, skip-testing, and test-file.
- Introduced a usage function to display help information.
- Implemented a function to derive test identifiers from file paths.
- Refactored the test execution command to accommodate new options and improve readability.

(cherry picked from commit cd1e1e2)
(cherry picked from commit 54853ad)
… allowing multiple runs. Updated BenchmarkExecutor to return execution time alongside bytes, and modified BenchmarkView to display execution time in results.
* main:
  chore: Make agents able to run unit tests (#141)
  chore(main): release 0.20.0 (#140)

# Conflicts:
#	Tests/SessionReplayTests/RRWebEventGeneratorTests.swift
#	test.sh
- Updated the ExportFrame structure to replace TileSignature with ImageSignature in AddImage and RemoveImage.
- Adjusted RRWebEventGenerator and related methods to accommodate the new image signature handling.
- Modified unit tests to ensure compatibility with the updated ExportFrame parameters.
@abelonogov-ld abelonogov-ld requested review from a team and mario-launchdarkly as code owners March 4, 2026 22:05
@abelonogov-ld abelonogov-ld changed the title chore: Matching Android in File Structure of SR data pipeline feat: Matching Android in File Structure of SR data pipeline Mar 4, 2026
@abelonogov-ld abelonogov-ld changed the title feat: Matching Android in File Structure of SR data pipeline feat: Matching Android f SR data pipeline (Moves compression before buffering) Mar 4, 2026
@abelonogov-ld abelonogov-ld changed the title feat: Matching Android f SR data pipeline (Moves compression before buffering) feat: Moves compression before buffer Mar 4, 2026
@abelonogov-ld abelonogov-ld changed the title feat: Moves compression before buffer feat: Moves compression before buffer (Optimization) Mar 4, 2026
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) March 4, 2026 22:16
…ift-launchdarkly-observability into andrey/exportdiffmanager

* 'andrey/exportdiffmanager' of github.com:launchdarkly/swift-launchdarkly-observability:
  chore(main): release 0.21.0 (#143)
  feat: Bridging hooks calls from MAUI (#142)
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Copy link
Copy Markdown
Contributor

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

Well-structured refactor moving compression before the buffer with new ExportDiffManager, benchmark harness, and expanded test coverage for keyframe/buffer behavior.

@abelonogov-ld abelonogov-ld merged commit 5bda445 into main Mar 5, 2026
5 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/exportdiffmanager branch March 5, 2026 00:15
abelonogov-ld pushed a commit that referenced this pull request Mar 5, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.0](0.21.0...0.22.0)
(2026-03-05)


### Features

* Moves compression before buffer (Optimization)
([#144](#144))
([5bda445](5bda445))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Release bookkeeping only (version/changelog updates) with no
functional code changes in this diff.
> 
> **Overview**
> Cuts the `0.22.0` release by bumping version metadata across the repo
(`.release-please-manifest.json`, both `.podspec`s, and
`Sources/LaunchDarklyObservability/Version.swift`).
> 
> Updates `CHANGELOG.md` with the `0.22.0` entry noting the optimization
to move compression before buffering.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9fac85e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
abelonogov-ld added a commit that referenced this pull request Mar 5, 2026
* main:
  chore(main): release 0.22.0 (#145)
  feat: Moves compression before buffer (Optimization) (#144)
  chore(main): release 0.21.0 (#143)
  feat: Bridging hooks calls from MAUI (#142)

# Conflicts:
#	Sources/LaunchDarklySessionReplay/BenchMark/BenchmarkExecutor.swift
#	Sources/LaunchDarklySessionReplay/ScreenCapture/TileSignatureManager.swift
#	TestApp/Sources/BenchmarkView.swift
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.

2 participants