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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TTFD waits for next drawn frame #3505

Merged
merged 2 commits into from Dec 19, 2023
Merged

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Dec 18, 2023

馃摐 Description

The SDK waits for the next drawn frame after users call reportFullyDisplayed to reflect when UI changes are visible to the user correctly.

馃挕 Motivation and Context

Preparation for #3471.

馃挌 How did you test it?

Unit tests and simulator.

馃摑 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • 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.
  • 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

codecov bot commented Dec 18, 2023

Codecov Report

Merging #3505 (e81bf86) into main (f0ce81c) will increase coverage by 0.006%.
The diff coverage is 100.000%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3505       +/-   ##
=============================================
+ Coverage   89.197%   89.204%   +0.006%     
=============================================
  Files          528       528               
  Lines        57431     57466       +35     
  Branches     20572     20599       +27     
=============================================
+ Hits         51227     51262       +35     
- Misses        5291      5295        +4     
+ Partials       913       909        -4     
Files Coverage 螖
Sources/Sentry/SentryTimeToDisplayTracker.m 100.000% <100.000%> (酶)
.../Sentry/SentryUIViewControllerPerformanceTracker.m 98.800% <100.000%> (酶)
...ce/SentryPerformanceTrackingIntegrationTests.swift 100.000% <酶> (酶)
...iewController/SentryTimeToDisplayTrackerTest.swift 99.618% <100.000%> (+1.642%) 猬嗭笍
...entryUIViewControllerPerformanceTrackerTests.swift 97.274% <100.000%> (+0.210%) 猬嗭笍

... and 15 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 f0ce81c...e81bf86. Read the comment docs.

Copy link

github-actions bot commented Dec 18, 2023

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 1197.37 ms 1215.67 ms 18.31 ms
Size 21.58 KiB 418.33 KiB 396.75 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
45d3ca5 1248.27 ms 1255.48 ms 7.21 ms
1437c68 1244.86 ms 1254.18 ms 9.32 ms
db31083 1252.52 ms 1266.65 ms 14.13 ms
32c4446 1225.00 ms 1231.29 ms 6.29 ms
7bb0873 1360.94 ms 1362.24 ms 1.30 ms
ad7cec6 1203.22 ms 1224.74 ms 21.52 ms
ff09c7e 1240.94 ms 1262.66 ms 21.72 ms
a176fc4 1239.78 ms 1258.98 ms 19.20 ms
3277f18 1229.29 ms 1248.92 ms 19.63 ms
8f397a7 1251.82 ms 1268.34 ms 16.52 ms

App size

Revision Plain With Sentry Diff
45d3ca5 20.76 KiB 427.54 KiB 406.78 KiB
1437c68 22.85 KiB 410.96 KiB 388.11 KiB
db31083 22.85 KiB 407.62 KiB 384.77 KiB
32c4446 22.84 KiB 403.24 KiB 380.39 KiB
7bb0873 22.85 KiB 407.09 KiB 384.24 KiB
ad7cec6 20.76 KiB 427.32 KiB 406.55 KiB
ff09c7e 20.76 KiB 427.76 KiB 407.00 KiB
a176fc4 22.84 KiB 403.24 KiB 380.39 KiB
3277f18 22.84 KiB 402.88 KiB 380.03 KiB
8f397a7 20.76 KiB 420.55 KiB 399.79 KiB

Previous results on branch: fix/ttfd-wait-frame

Startup times

Revision Plain With Sentry Diff
dcef2fe 1239.04 ms 1252.16 ms 13.12 ms

App size

Revision Plain With Sentry Diff
dcef2fe 21.58 KiB 418.48 KiB 396.90 KiB

@brustolin
Copy link
Contributor

brustolin commented Dec 18, 2023

The SDK waits for the next drawn frame after users call reportFullyDisplayed to reflect when UI changes are visible to the user correctly. As this change is a breaking change, this fix only works when enabling performance V2

This was always the intention, if its not working properly, I don't think is a breaking change fixing it. I prefer to not add this V2 thing.

@philipphofmann
Copy link
Member Author

Okay, I didn't know it was the intention. We will add the V2 option, but it's better if we use it sparingly. I will update the PR.

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

LGTM

Sources/Sentry/SentryTimeToDisplayTracker.m Show resolved Hide resolved
@philipphofmann philipphofmann merged commit fac579e into main Dec 19, 2023
71 checks passed
@philipphofmann philipphofmann deleted the fix/ttfd-wait-frame branch December 19, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants