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

iOS copy native replay screenshot in-memory to native #2530

Merged
merged 9 commits into from
Dec 24, 2024

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented Dec 20, 2024

📜 Description

Sending binary data (uint8list) over method channels is rather slow so instead, we allocate the memory directly in dart and only send the address and length & restore the object in objective-c.

Following screenshots show profiling flamechart (combined data) over 20-ish seconds before and after this PR. I've highlighted the relevant part
Screenshot 2024-12-20 at 20 33 16
Screenshot 2024-12-20 at 20 35 24

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Dec 20, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1253.47 ms 1270.53 ms 17.06 ms
Size 8.42 MiB 9.86 MiB 1.44 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
be173fa 1364.84 ms 1424.49 ms 59.65 ms
24f71aa 1267.47 ms 1272.00 ms 4.53 ms
7224aae 1246.78 ms 1268.35 ms 21.58 ms
9f9dd52 1364.63 ms 1394.89 ms 30.25 ms
abcdba3 1257.31 ms 1283.49 ms 26.18 ms
77db8d4 1228.47 ms 1248.80 ms 20.33 ms
905bf99 1240.84 ms 1271.47 ms 30.63 ms
cf91c9d 1217.08 ms 1233.00 ms 15.92 ms
1c6eb5b 1277.85 ms 1285.71 ms 7.86 ms
13f8952 1249.98 ms 1278.31 ms 28.33 ms

App size

Revision Plain With Sentry Diff
be173fa 8.33 MiB 9.54 MiB 1.22 MiB
24f71aa 8.10 MiB 9.16 MiB 1.07 MiB
7224aae 8.42 MiB 9.83 MiB 1.40 MiB
9f9dd52 8.33 MiB 9.63 MiB 1.29 MiB
abcdba3 8.15 MiB 9.12 MiB 989.76 KiB
77db8d4 8.38 MiB 9.73 MiB 1.35 MiB
905bf99 8.38 MiB 9.74 MiB 1.36 MiB
cf91c9d 8.33 MiB 9.40 MiB 1.07 MiB
1c6eb5b 8.15 MiB 9.12 MiB 986.27 KiB
13f8952 8.38 MiB 9.78 MiB 1.40 MiB

Previous results on branch: enha/replay-copy-image-in-memory

Startup times

Revision Plain With Sentry Diff
3c54d06 1262.06 ms 1272.44 ms 10.38 ms
cd51c10 1241.50 ms 1266.69 ms 25.19 ms

App size

Revision Plain With Sentry Diff
3c54d06 8.42 MiB 9.86 MiB 1.44 MiB
cd51c10 8.42 MiB 9.86 MiB 1.44 MiB

Copy link
Contributor

github-actions bot commented Dec 20, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 468.43 ms 511.92 ms 43.49 ms
Size 6.46 MiB 7.48 MiB 1.01 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a510d1d 295.63 ms 344.65 ms 49.03 ms
8fa3934 340.64 ms 407.92 ms 67.28 ms
1d47eb7 282.26 ms 342.52 ms 60.26 ms
68677de 364.41 ms 415.61 ms 51.20 ms
0a23f98 377.19 ms 416.18 ms 39.00 ms
3de8b9b 348.55 ms 445.84 ms 97.29 ms
bd75526 515.20 ms 568.79 ms 53.59 ms
c1bb00f 303.77 ms 371.88 ms 68.11 ms
211a7aa 324.19 ms 393.26 ms 69.07 ms
04211b9 502.46 ms 542.29 ms 39.83 ms

App size

Revision Plain With Sentry Diff
a510d1d 5.94 MiB 6.96 MiB 1.02 MiB
8fa3934 6.06 MiB 7.09 MiB 1.03 MiB
1d47eb7 6.16 MiB 7.14 MiB 1010.29 KiB
68677de 6.06 MiB 7.10 MiB 1.04 MiB
0a23f98 6.06 MiB 7.03 MiB 996.97 KiB
3de8b9b 6.27 MiB 7.20 MiB 957.75 KiB
bd75526 6.49 MiB 7.56 MiB 1.07 MiB
c1bb00f 6.06 MiB 7.09 MiB 1.03 MiB
211a7aa 6.06 MiB 7.03 MiB 997.24 KiB
04211b9 6.49 MiB 7.57 MiB 1.08 MiB

Previous results on branch: enha/replay-copy-image-in-memory

Startup times

Revision Plain With Sentry Diff
cd51c10 438.06 ms 497.23 ms 59.17 ms
3c54d06 435.34 ms 501.85 ms 66.51 ms

App size

Revision Plain With Sentry Diff
cd51c10 6.46 MiB 7.48 MiB 1.01 MiB
3c54d06 6.46 MiB 7.48 MiB 1.01 MiB

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.99%. Comparing base (8eacc40) to head (6543a63).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2530      +/-   ##
==========================================
+ Coverage   86.97%   91.99%   +5.02%     
==========================================
  Files         265       89     -176     
  Lines        9413     3087    -6326     
==========================================
- Hits         8187     2840    -5347     
+ Misses       1226      247     -979     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vaind vaind marked this pull request as ready for review December 22, 2024 14:39
@vaind vaind added the Blocked label Dec 23, 2024
@vaind vaind merged commit 6159a2f into main Dec 24, 2024
55 of 56 checks passed
@vaind vaind deleted the enha/replay-copy-image-in-memory branch December 24, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants