PoC: Move NDK from sentry-java to sentry-native
:scroll: Description
Relevant sentry-native PR: https://github.com/getsentry/sentry-native/pull/944
To make this branch work, you need to publish the sentry-native ndk artifact first:
-
cd sentry-native/ndk -
./gradlew :lib:publishToMavenLocal
:bulb: Motivation and Context
Move NDK code over to sentry-native, to make it more testable and robust.
So far all looks good, but using sentry.h / linking libsentry.so does not work, as the sentry-native git submodule is not present anymore. However we're using https://github.com/howardpang/androidNativeBundle, which apart from publishing, also allows you to consume .h/.so files: https://github.com/howardpang/androidNativeBundle#3-import-aar
:green_heart: How did you test it?
:pencil: Checklist
- [ ] I reviewed the submitted code.
- [ ] I added tests to verify the changes.
- [ ] No new PII added or SDK only sends newly added PII if
sendDefaultPIIis 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.
:crystal_ball: Next steps
| Messages | |
|---|---|
| :book: | Do not forget to update Sentry-docs with your feature once the pull request gets approved. |
Generated by :no_entry_sign: dangerJS against 14b2cfd057978a234b8e23728141c54f855a83b8
Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 472.25 ms | 544.23 ms | 71.98 ms |
| Size | 1.70 MiB | 2.28 MiB | 597.68 KiB |
Baseline results on branch: 8.x.x
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a373f020dc423eab02ff263f005494d00c57e2c4 | 372.81 ms | 432.96 ms | 60.15 ms |
| 3e1e45bf7179435cf8da8c7d2ee1511bb585485e | 373.72 ms | 439.33 ms | 65.60 ms |
| dcad3c9309c1849fe21f1d4dceaa0a7990477d1e | 400.04 ms | 479.67 ms | 79.62 ms |
| 6f168826c814df0d6651918b2f7ff0e7ece4c639 | 426.16 ms | 494.15 ms | 67.99 ms |
| 9f2c8552fd8bf28926a24cb82be26f6a48a50183 | 424.20 ms | 506.34 ms | 82.14 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a373f020dc423eab02ff263f005494d00c57e2c4 | 1.70 MiB | 2.28 MiB | 596.35 KiB |
| 3e1e45bf7179435cf8da8c7d2ee1511bb585485e | 1.70 MiB | 2.28 MiB | 596.32 KiB |
| dcad3c9309c1849fe21f1d4dceaa0a7990477d1e | 1.70 MiB | 2.28 MiB | 596.35 KiB |
| 6f168826c814df0d6651918b2f7ff0e7ece4c639 | 1.70 MiB | 2.28 MiB | 596.37 KiB |
| 9f2c8552fd8bf28926a24cb82be26f6a48a50183 | 1.70 MiB | 2.28 MiB | 596.32 KiB |