Skip to content

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Jul 29, 2025

Step towards #1444

💚 How did you test it?

It's currently hard to mock JNI/FFI calls so we'll be relying on integration tests and verifying that method channel calls are not made anymore for captureEnvelope

Performance improvement is marginal but an improvement nonetheless


iOS:
FFI calls (26 samples):
Average ≈ 2 967.4 microseconds

Channel calls (25 samples):
Average ≈ 3 264.5 microseconds


Android:
JNI calls (33 samples):
Average ≈ 1 012.8 microseconds

Channel calls (32 samples):
Average ≈ 1 462.5 microseconds


📝 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

@sentry review

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.79%. Comparing base (36820e8) to head (23ae401).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3115      +/-   ##
==========================================
+ Coverage   87.77%   87.79%   +0.02%     
==========================================
  Files         291      103     -188     
  Lines        9952     4097    -5855     
==========================================
- Hits         8735     3597    -5138     
+ Misses       1217      500     -717     

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

Copy link
Contributor

github-actions bot commented Jul 29, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1271.96 ms 1271.44 ms -0.52 ms
Size 5.53 MiB 5.97 MiB 453.71 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
73dca78 1246.65 ms 1265.42 ms 18.76 ms
c8596a6 1234.11 ms 1241.19 ms 7.08 ms
7cfee3b 1260.90 ms 1273.14 ms 12.24 ms
eca355d 1238.39 ms 1266.98 ms 28.59 ms
79f6b41 1269.33 ms 1279.71 ms 10.38 ms
ec78888 1251.37 ms 1269.40 ms 18.04 ms
2d34233 1258.19 ms 1268.92 ms 10.73 ms
793f4dc 1262.50 ms 1282.35 ms 19.85 ms
4481076 1256.48 ms 1266.64 ms 10.17 ms
93b7728 1247.23 ms 1264.87 ms 17.64 ms

App size

Revision Plain With Sentry Diff
73dca78 7.86 MiB 9.44 MiB 1.58 MiB
c8596a6 7.86 MiB 9.44 MiB 1.58 MiB
7cfee3b 20.70 MiB 22.46 MiB 1.75 MiB
eca355d 7.86 MiB 9.44 MiB 1.58 MiB
79f6b41 7.86 MiB 9.44 MiB 1.58 MiB
ec78888 7.86 MiB 9.44 MiB 1.58 MiB
2d34233 7.86 MiB 9.44 MiB 1.58 MiB
793f4dc 7.86 MiB 9.44 MiB 1.58 MiB
4481076 7.86 MiB 9.44 MiB 1.58 MiB
93b7728 7.86 MiB 9.44 MiB 1.58 MiB

Previous results on branch: enh/ffi-jni-capture-envelope

Startup times

Revision Plain With Sentry Diff
f61db9e 1225.65 ms 1228.74 ms 3.10 ms
4d265af 1274.31 ms 1284.55 ms 10.24 ms
d9df09c 1271.86 ms 1274.88 ms 3.02 ms
8243b86 1256.24 ms 1268.31 ms 12.06 ms
5fa2e5f 1233.29 ms 1237.04 ms 3.75 ms
fcdc0a0 1270.39 ms 1282.24 ms 11.86 ms

App size

Revision Plain With Sentry Diff
f61db9e 5.53 MiB 5.97 MiB 453.66 KiB
4d265af 7.86 MiB 9.45 MiB 1.59 MiB
d9df09c 5.53 MiB 5.97 MiB 454.13 KiB
8243b86 7.86 MiB 9.45 MiB 1.59 MiB
5fa2e5f 7.86 MiB 9.45 MiB 1.59 MiB
fcdc0a0 7.86 MiB 9.45 MiB 1.59 MiB

Copy link
Contributor

github-actions bot commented Jul 29, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 467.52 ms 468.60 ms 1.08 ms
Size 13.93 MiB 14.93 MiB 1.00 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
93b7728 475.28 ms 489.13 ms 13.86 ms
c8596a6 474.00 ms 492.96 ms 18.96 ms
73a3c38 478.18 ms 526.62 ms 48.44 ms
0fb45d0 482.79 ms 554.02 ms 71.23 ms
640ad0c 466.00 ms 552.67 ms 86.67 ms
765aa8b 493.51 ms 531.23 ms 37.72 ms
cc4e375 426.15 ms 482.34 ms 56.19 ms
c1e775e 482.36 ms 608.98 ms 126.62 ms
2d34233 470.54 ms 558.90 ms 88.36 ms
54acf91 487.24 ms 529.60 ms 42.36 ms

App size

Revision Plain With Sentry Diff
93b7728 6.54 MiB 7.69 MiB 1.15 MiB
c8596a6 6.54 MiB 7.53 MiB 1015.27 KiB
73a3c38 6.54 MiB 7.69 MiB 1.15 MiB
0fb45d0 6.54 MiB 7.70 MiB 1.17 MiB
640ad0c 6.54 MiB 7.69 MiB 1.15 MiB
765aa8b 6.54 MiB 7.70 MiB 1.16 MiB
cc4e375 6.54 MiB 7.69 MiB 1.15 MiB
c1e775e 6.54 MiB 7.70 MiB 1.17 MiB
2d34233 6.54 MiB 7.55 MiB 1.01 MiB
54acf91 6.54 MiB 7.70 MiB 1.17 MiB

Previous results on branch: enh/ffi-jni-capture-envelope

Startup times

Revision Plain With Sentry Diff
8243b86 480.34 ms 499.35 ms 19.01 ms
f61db9e 458.13 ms 464.74 ms 6.61 ms
fcdc0a0 504.15 ms 536.24 ms 32.09 ms
4d265af 451.48 ms 506.33 ms 54.85 ms
5fa2e5f 508.60 ms 556.53 ms 47.93 ms

App size

Revision Plain With Sentry Diff
8243b86 6.54 MiB 7.71 MiB 1.17 MiB
f61db9e 13.93 MiB 14.93 MiB 1.00 MiB
fcdc0a0 6.54 MiB 7.71 MiB 1.17 MiB
4d265af 6.54 MiB 7.71 MiB 1.17 MiB
5fa2e5f 6.54 MiB 7.71 MiB 1.17 MiB

Copy link
Contributor

github-actions bot commented Jul 29, 2025

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

@buenaflor buenaflor marked this pull request as ready for review August 7, 2025 12:08
cursor[bot]

This comment was marked as outdated.

@buenaflor buenaflor requested a review from vaind August 7, 2025 12:39
cursor[bot]

This comment was marked as outdated.

Base automatically changed from deps/bump-ffigen to main August 14, 2025 09:06
@buenaflor buenaflor marked this pull request as ready for review August 26, 2025 13:22
cursor[bot]

This comment was marked as outdated.

Copy link
Collaborator

@denrase denrase left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@buenaflor buenaflor merged commit 8825ed8 into main Aug 27, 2025
69 of 71 checks passed
@buenaflor buenaflor deleted the enh/ffi-jni-capture-envelope branch August 27, 2025 17:19
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.

3 participants