Skip to content

Conversation

armcknight
Copy link
Member

@armcknight armcknight commented Jul 10, 2025

It was pointed out that we're performing JSON serialization of continuous profiling chunks on the main thread. Move it off to a background thread similar to how it was done for transaction profiling in #4377.

Modified a test to ensure the proper queue-based functionality.

I also ran the continuous profiler with the CPU work feature in the benchmarking tab of the iOS-Swift sample app to ensure data is still making it to our backend:
image

@armcknight armcknight changed the title Armcknight/impr/profile serialization off main thread impr(profiling): continuous chunk serialization off main thread Jul 10, 2025
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.069%. Comparing base (b045d0a) to head (6a1a563).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5613       +/-   ##
=============================================
- Coverage   86.483%   86.069%   -0.415%     
=============================================
  Files          415       415               
  Lines        35291     35268       -23     
  Branches     15271     14973      -298     
=============================================
- Hits         30521     30355      -166     
- Misses        4728      4872      +144     
+ Partials        42        41        -1     
Files with missing lines Coverage Δ
...urces/Sentry/Profiling/SentryContinuousProfiler.mm 91.666% <100.000%> (+0.238%) ⬆️
Sources/Sentry/SentryMetricProfiler.m 97.948% <100.000%> (+0.065%) ⬆️

... and 32 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 b045d0a...6a1a563. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Jul 10, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1221.25 ms 1240.24 ms 18.99 ms
Size 23.75 KiB 880.45 KiB 856.71 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
fd5961e 1210.59 ms 1235.57 ms 24.98 ms
035974f 1225.89 ms 1251.23 ms 25.34 ms
2b02431 1229.63 ms 1248.98 ms 19.35 ms
e0424b9 1204.23 ms 1241.08 ms 36.85 ms
2481950 1221.04 ms 1248.98 ms 27.94 ms
d05d866 1211.78 ms 1230.96 ms 19.18 ms
e64d3d4 1241.90 ms 1260.10 ms 18.20 ms
acac774 1217.76 ms 1253.29 ms 35.52 ms
4d264fa 1223.48 ms 1246.91 ms 23.44 ms
884b224 1221.11 ms 1255.88 ms 34.77 ms

App size

Revision Plain With Sentry Diff
fd5961e 23.74 KiB 874.07 KiB 850.32 KiB
035974f 23.74 KiB 874.07 KiB 850.33 KiB
2b02431 23.75 KiB 850.73 KiB 826.98 KiB
e0424b9 23.74 KiB 874.07 KiB 850.33 KiB
2481950 23.74 KiB 872.74 KiB 849.00 KiB
d05d866 23.75 KiB 878.60 KiB 854.85 KiB
e64d3d4 23.75 KiB 855.37 KiB 831.62 KiB
acac774 23.75 KiB 866.51 KiB 842.76 KiB
4d264fa 23.74 KiB 874.07 KiB 850.33 KiB
884b224 23.75 KiB 879.55 KiB 855.80 KiB

Previous results on branch: armcknight/impr/profile-serialization-off-main-thread

Startup times

Revision Plain With Sentry Diff
0c4d824 1230.27 ms 1248.56 ms 18.30 ms

App size

Revision Plain With Sentry Diff
0c4d824 23.75 KiB 880.54 KiB 856.80 KiB

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.

Thanks @armcknight, LGTM with one comment.

Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
@armcknight armcknight merged commit 501c3d9 into main Jul 11, 2025
123 of 127 checks passed
@armcknight armcknight deleted the armcknight/impr/profile-serialization-off-main-thread branch July 11, 2025 21:05
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