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

Add flag to disable native profilers #4094

Merged
merged 8 commits into from
Sep 17, 2024
Merged

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Sep 16, 2024

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

  • Adds a flag platformProviders for the hermes profling integration to disable profiling of native threads, which only leaves JS profiling enabled and avoids potential crashes that the native SDKs profiling can introduce. Defaults to true

I ran the samples locally and verified that enabling/disabling the flag adds/removes native threads from the profiles, see:

Flag enabled:

Flag disabled:
Google Chrome 2024-09-16 17 02 24

💡 Motivation and Context

Closes #4085

💚 How did you test it?

See links for Android:

Flag enabled: https://sentry-sdks.sentry.io/profiling/profile/sentry-react-native/f95eae4eda2b413b9802c2bee89582da/flamegraph/
Flag disabled: https://sentry-sdks.sentry.io/profiling/profile/sentry-react-native/0e07464e9c784d408525cd118cdade00/flamegraph/

See links for iOS:

Flag enabled: https://sentry-sdks.sentry.io/profiling/profile/sentry-react-native/8cb25ce8b911427485d831fe01109f38/flamegraph/
Flag disabled: https://sentry-sdks.sentry.io/profiling/profile/sentry-react-native/7bbaf5bdff8b46ca85063a98f38200c6/flamegraph/

📝 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
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 473.56 ms 482.08 ms 8.52 ms
Size 17.73 MiB 20.07 MiB 2.33 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6e8584e 447.10 ms 474.71 ms 27.61 ms
5446992 403.40 ms 426.70 ms 23.30 ms
457e29f 398.10 ms 421.39 ms 23.29 ms
1c65324 426.37 ms 460.36 ms 33.99 ms
f06c879 408.41 ms 424.54 ms 16.13 ms
22e31b6 396.48 ms 419.64 ms 23.16 ms
baa882f 354.93 ms 356.18 ms 1.25 ms
3853f43 329.68 ms 346.32 ms 16.64 ms
2534337 394.15 ms 415.12 ms 20.97 ms
9a3ca65+dirty 326.93 ms 330.14 ms 3.21 ms

App size

Revision Plain With Sentry Diff
6e8584e 17.73 MiB 19.86 MiB 2.12 MiB
5446992 17.73 MiB 19.85 MiB 2.12 MiB
457e29f 17.73 MiB 19.84 MiB 2.10 MiB
1c65324 17.73 MiB 19.95 MiB 2.21 MiB
f06c879 17.73 MiB 19.85 MiB 2.12 MiB
22e31b6 17.73 MiB 19.84 MiB 2.10 MiB
baa882f 17.73 MiB 20.06 MiB 2.33 MiB
3853f43 17.73 MiB 19.81 MiB 2.08 MiB
2534337 17.73 MiB 19.84 MiB 2.11 MiB
9a3ca65+dirty 17.73 MiB 20.04 MiB 2.31 MiB

Copy link
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1209.39 ms 1220.48 ms 11.09 ms
Size 2.36 MiB 3.08 MiB 734.20 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0677344+dirty 1276.70 ms 1300.07 ms 23.37 ms
0ebca77+dirty 1220.75 ms 1222.81 ms 2.06 ms
70caa60+dirty 1218.27 ms 1230.30 ms 12.03 ms
1d86dd6+dirty 1249.71 ms 1279.16 ms 29.45 ms
c2a4e9b+dirty 1240.10 ms 1239.22 ms -0.88 ms
ad6c299+dirty 1244.76 ms 1260.10 ms 15.34 ms
34aba08+dirty 1276.78 ms 1308.52 ms 31.74 ms
abb7058+dirty 1255.42 ms 1268.86 ms 13.44 ms
80b2ce3+dirty 1265.92 ms 1268.60 ms 2.69 ms
15c80ab+dirty 1223.74 ms 1228.96 ms 5.22 ms

App size

Revision Plain With Sentry Diff
0677344+dirty 2.36 MiB 2.85 MiB 496.81 KiB
0ebca77+dirty 2.36 MiB 3.04 MiB 698.33 KiB
70caa60+dirty 2.36 MiB 2.83 MiB 479.27 KiB
1d86dd6+dirty 2.36 MiB 2.89 MiB 535.43 KiB
c2a4e9b+dirty 2.36 MiB 3.08 MiB 734.00 KiB
ad6c299+dirty 2.36 MiB 2.84 MiB 488.85 KiB
34aba08+dirty 2.36 MiB 2.85 MiB 495.32 KiB
abb7058+dirty 2.36 MiB 2.87 MiB 520.42 KiB
80b2ce3+dirty 2.36 MiB 2.84 MiB 486.98 KiB
15c80ab+dirty 2.36 MiB 2.83 MiB 474.49 KiB

Copy link
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 397.00 ms 426.19 ms 29.19 ms
Size 7.15 MiB 8.34 MiB 1.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0db0c72+dirty 335.20 ms 351.06 ms 15.86 ms
80b2ce3+dirty 271.29 ms 316.47 ms 45.18 ms
abb7058+dirty 320.78 ms 324.08 ms 3.30 ms
5bb8d5f+dirty 356.71 ms 389.65 ms 32.94 ms
1d86dd6+dirty 335.76 ms 371.22 ms 35.46 ms
2534337+dirty 597.14 ms 665.04 ms 67.90 ms
0ebca77+dirty 360.94 ms 402.24 ms 41.30 ms
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
9a3ca65+dirty 344.96 ms 358.92 ms 13.96 ms
d0bf494+dirty 253.73 ms 308.23 ms 54.49 ms

App size

Revision Plain With Sentry Diff
0db0c72+dirty 7.15 MiB 8.04 MiB 911.02 KiB
80b2ce3+dirty 7.15 MiB 8.04 MiB 911.02 KiB
abb7058+dirty 7.15 MiB 8.10 MiB 980.40 KiB
5bb8d5f+dirty 7.15 MiB 8.21 MiB 1.06 MiB
1d86dd6+dirty 7.15 MiB 8.13 MiB 1002.18 KiB
2534337+dirty 7.15 MiB 8.11 MiB 988.68 KiB
0ebca77+dirty 7.15 MiB 8.22 MiB 1.07 MiB
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
9a3ca65+dirty 7.15 MiB 8.09 MiB 962.83 KiB
d0bf494+dirty 7.15 MiB 8.04 MiB 910.85 KiB

Copy link
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.39 ms 1227.06 ms -0.33 ms
Size 2.92 MiB 3.64 MiB 740.56 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0677344+dirty 1252.52 ms 1254.08 ms 1.56 ms
0ebca77+dirty 1209.30 ms 1220.33 ms 11.03 ms
70caa60+dirty 1279.08 ms 1281.54 ms 2.46 ms
1d86dd6+dirty 1289.25 ms 1293.36 ms 4.11 ms
c2a4e9b+dirty 1247.39 ms 1243.04 ms -4.35 ms
ad6c299+dirty 1248.50 ms 1248.88 ms 0.38 ms
34aba08+dirty 1268.58 ms 1276.80 ms 8.22 ms
abb7058+dirty 1260.28 ms 1266.56 ms 6.28 ms
80b2ce3+dirty 1245.12 ms 1262.04 ms 16.92 ms
15c80ab+dirty 1248.41 ms 1251.24 ms 2.83 ms

App size

Revision Plain With Sentry Diff
0677344+dirty 2.92 MiB 3.41 MiB 500.94 KiB
0ebca77+dirty 2.92 MiB 3.61 MiB 705.12 KiB
70caa60+dirty 2.92 MiB 3.39 MiB 486.04 KiB
1d86dd6+dirty 2.92 MiB 3.44 MiB 538.27 KiB
c2a4e9b+dirty 2.92 MiB 3.64 MiB 739.91 KiB
ad6c299+dirty 2.92 MiB 3.40 MiB 494.12 KiB
34aba08+dirty 2.92 MiB 3.41 MiB 499.03 KiB
abb7058+dirty 2.92 MiB 3.43 MiB 524.53 KiB
80b2ce3+dirty 2.92 MiB 3.40 MiB 492.75 KiB
15c80ab+dirty 2.92 MiB 3.39 MiB 481.56 KiB

CHANGELOG.md Show resolved Hide resolved
Copy link
Collaborator

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Awesome work @romtsn 🎉
The code LGTM! Thank you for including my suggestions 🙇

@romtsn romtsn merged commit 9a727cb into main Sep 17, 2024
58 of 62 checks passed
@romtsn romtsn deleted the rz/feat/hermes-profiling-only branch September 17, 2024 12:23
romtsn added a commit that referenced this pull request Sep 17, 2024
romtsn added a commit that referenced this pull request Sep 17, 2024
* Add flag to disable native profilers (#4094)

* Revert

* release: 5.24.2

* Merge leftovers

* revert

---------

Co-authored-by: getsentry-bot <[email protected]>
Co-authored-by: getsentry-bot <[email protected]>
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.

Add option to hermesProfilingIntegration to only profile Hermes JS
2 participants