Skip to content

Conversation

@jamesnrokt
Copy link
Collaborator

@jamesnrokt jamesnrokt commented Jan 15, 2026

Background

  • Requests to assess the size impact of the mParticle SDK are frequent and currently require manual analysis and reporting.
  • This PR introduces an automated solution that eliminates this manual overhead, reducing engineering time and operational cost.
  • It also adds continuous size monitoring, available during pull requests and via a GitHub Actions workflow, giving developers early visibility into the impact of proposed changes and helping prevent unintentional SDK bloat.

diagram-mparticle-ios-sdk-size-monitoring

What Has Changed

  • New workflow: size-report.yml runs on every PR or manually triggered
  • Accurate measurement: SDK built from source, not pre-built binaries
  • Visible feedback: Size impact posted as PR comment with delta from target branch

Screenshots/Video

Screenshot 2026-01-16 at 11 16 06 AM

Source

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • This system does not factor in any benefits gained through app thinning as I didn't want to introduce signing complexities

Reference Issue (For employees only. Ignore if you are an outside contributor)

  • Closes N/A

@jamesnrokt jamesnrokt requested a review from a team as a code owner January 15, 2026 05:02
thomson-t
thomson-t previously approved these changes Jan 15, 2026
Copy link
Contributor

@thomson-t thomson-t left a comment

Choose a reason for hiding this comment

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

Awesome feature 🎉
I would imagine we will have to add a similar report in kits if we want to measure the size of those indirect dependencies.

echo " Creating xcframework..." >&2
xcodebuild -create-xcframework \
-archive "${ARCHIVES_DIR}/mParticle-Apple-SDK-iOS.xcarchive" -framework mParticle_Apple_SDK.framework \
-output "${BUILD_DIR}/mParticle_Apple_SDK.xcframework" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include the size of mParticle_Apple_SDK.xcframework as well in the report?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@thomson-t The report now generates this as part of the comment on PRs and the script report. Example here

Copy link
Contributor

@denischilik denischilik left a comment

Choose a reason for hiding this comment

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

I would suggest to create only one app with two targets, where one will be with SDK second without. It will be also good to generate them with Tuist even if we keep xcode project under the repo control.

@github-actions
Copy link

github-actions bot commented Jan 15, 2026

📦 SDK Size Impact Report

Measures how much the SDK adds to an app's size (with-SDK minus without-SDK).

Metric Target Branch This PR Change
App Bundle Impact N/A 1.75 MB N/A (new baseline)
Executable Impact N/A 896 bytes N/A (new baseline)
XCFramework Size N/A 9.37 MB N/A (new baseline)

ℹ️ Size test app not found on target branch. This is the new baseline.

Raw measurements

Target branch (main):

{"sdk_impact_kb": 0, "sdk_executable_impact_bytes": 0, "xcframework_size_kb": 0}

This PR:

{"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1876,"with_sdk_executable_size_bytes":76360,"sdk_impact_kb":1792,"sdk_executable_impact_bytes":896,"xcframework_size_kb":9592}

@jamesnrokt
Copy link
Collaborator Author

I would suggest to create only one app with two targets, where one will be with SDK second without. It will be also good to generate them with Tuist even if we keep xcode project under the repo control.

@denischilik I considered both of these approaches but went down the route of separate apps without Tuist for ease of partner understanding and overall simplicity. With this approach they can immediately open the projects without using Tuist, a 3rd party tool they may not have. Additionally they can open both projects at once to compare the differences without having to dig into what each separate target is doing

@mParticle mParticle deleted a comment from github-actions bot Jan 17, 2026
@mParticle mParticle deleted a comment from github-actions bot Jan 17, 2026
@denischilik denischilik self-requested a review January 20, 2026 17:04
Copy link
Contributor

@denischilik denischilik left a comment

Choose a reason for hiding this comment

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

LGTM

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