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

fix: Don't start the SDK inside Xcode preview #4601

Merged
merged 53 commits into from
Jan 20, 2025

Conversation

brustolin
Copy link
Contributor

📜 Description

The SDK was running inside Xcode preview for SwiftUI and slowing things down for development.

💚 How did you test it?

Sample and Unit test

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link

github-actions bot commented Dec 5, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1233.09 ms 1243.81 ms 10.72 ms
Size 22.31 KiB 772.04 KiB 749.73 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
888a145 1235.15 ms 1254.82 ms 19.67 ms
825f0cb 1220.53 ms 1236.18 ms 15.65 ms
4bca912 1252.42 ms 1260.06 ms 7.64 ms
39b1c35 1209.73 ms 1232.40 ms 22.67 ms
2405ba5 1248.37 ms 1259.30 ms 10.93 ms
af1f4dd 1238.08 ms 1258.48 ms 20.40 ms
2124551 1265.50 ms 1276.44 ms 10.94 ms
4d6f273 1195.63 ms 1232.22 ms 36.59 ms
52e4912 1216.25 ms 1226.69 ms 10.44 ms
3033115 1260.10 ms 1263.58 ms 3.48 ms

App size

Revision Plain With Sentry Diff
888a145 21.58 KiB 713.54 KiB 691.95 KiB
825f0cb 22.31 KiB 771.42 KiB 749.10 KiB
4bca912 22.85 KiB 411.14 KiB 388.29 KiB
39b1c35 22.85 KiB 408.88 KiB 386.03 KiB
2405ba5 20.76 KiB 435.23 KiB 414.47 KiB
af1f4dd 22.85 KiB 414.71 KiB 391.86 KiB
2124551 22.85 KiB 411.69 KiB 388.84 KiB
4d6f273 20.76 KiB 426.93 KiB 406.17 KiB
52e4912 21.58 KiB 418.14 KiB 396.56 KiB
3033115 22.85 KiB 405.84 KiB 382.99 KiB

Previous results on branch: feat/disableSDKSwiftUIPreview

Startup times

Revision Plain With Sentry Diff
f1ed17a 1222.94 ms 1241.67 ms 18.73 ms
b421d36 1234.29 ms 1249.18 ms 14.89 ms
c994cb9 1231.63 ms 1255.37 ms 23.74 ms
3578731 1221.36 ms 1245.63 ms 24.28 ms
db8a1d5 1245.84 ms 1263.08 ms 17.24 ms
0cb9336 1223.10 ms 1244.09 ms 20.99 ms
3965049 1228.13 ms 1242.18 ms 14.06 ms
9ce8938 1233.04 ms 1254.67 ms 21.63 ms

App size

Revision Plain With Sentry Diff
f1ed17a 22.31 KiB 756.92 KiB 734.61 KiB
b421d36 22.30 KiB 750.94 KiB 728.64 KiB
c994cb9 22.30 KiB 750.89 KiB 728.59 KiB
3578731 22.30 KiB 750.89 KiB 728.59 KiB
db8a1d5 22.30 KiB 750.94 KiB 728.64 KiB
0cb9336 22.30 KiB 750.89 KiB 728.59 KiB
3965049 22.30 KiB 750.83 KiB 728.52 KiB
9ce8938 22.30 KiB 750.82 KiB 728.52 KiB

CHANGELOG.md Outdated Show resolved Hide resolved
Sources/Sentry/SentrySDK.m Outdated Show resolved Hide resolved
Sources/SentrySwiftUI/SentryTracedView.swift Outdated Show resolved Hide resolved
Sources/Sentry/SentrySDK.m Outdated Show resolved Hide resolved
Tests/SentryTests/SentrySDKTests.swift Outdated Show resolved Hide resolved
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

You all convinced me. Thanks for the PR, @brustolin, and thanks for all the extra context, @armcknight. LGTM when adding some log messages.

Sources/Sentry/SentrySDK.m Outdated Show resolved Hide resolved
Sources/Sentry/SentrySDK.m Show resolved Hide resolved
Sources/SentrySwiftUI/SentryTracedView.swift Outdated Show resolved Hide resolved
@philipphofmann
Copy link
Member

@brustolin, is anything stopping us from merging this?

@brustolin
Copy link
Contributor Author

@brustolin, is anything stopping us from merging this?

I’m just waiting to finish the SwiftUI TTID PR because this code was created on top of that one, and I don’t want to add it to the other PR and have it reviewed again.

Base automatically changed from feat/swiftui-ttid to main January 20, 2025 07:32
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.203%. Comparing base (825f0cb) to head (650a64b).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4601       +/-   ##
=============================================
+ Coverage   91.198%   91.203%   +0.004%     
=============================================
  Files          621       621               
  Lines        72365     72389       +24     
  Branches     26347     26356        +9     
=============================================
+ Hits         65996     66021       +25     
- Misses        6269      6270        +1     
+ Partials       100        98        -2     
Files with missing lines Coverage Δ
...ntryTestUtils/TestSentryNSProcessInfoWrapper.swift 100.000% <100.000%> (ø)
Sources/Sentry/SentryNSProcessInfoWrapper.mm 66.666% <100.000%> (+3.703%) ⬆️
Sources/Sentry/SentrySDK.m 87.613% <100.000%> (+0.189%) ⬆️
Tests/SentryTests/SentrySDKTests.swift 96.745% <100.000%> (+0.049%) ⬆️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 825f0cb...650a64b. Read the comment docs.

Copy link
Contributor

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM

@brustolin brustolin merged commit f59d0bf into main Jan 20, 2025
71 checks passed
@brustolin brustolin deleted the feat/disableSDKSwiftUIPreview branch January 20, 2025 10:18
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.

5 participants