Skip to content

Re-apply NDK init performance improvements for 8.x.x#3914

Merged
markushi merged 3 commits into8.x.xfrom
chore/bump-sentry-ndk
Nov 21, 2024
Merged

Re-apply NDK init performance improvements for 8.x.x#3914
markushi merged 3 commits into8.x.xfrom
chore/bump-sentry-ndk

Conversation

@markushi
Copy link
Copy Markdown
Member

@markushi markushi commented Nov 20, 2024

📜 Description

Re-applies the NDK optimizations done on the 7.x.x branch: https://github.com/getsentry/sentry-java/blob/3d24791bd1b80d3dbf8a849d9f23bf14445902c9/sentry-android-ndk/src/main/java/io/sentry/android/ndk/SentryNdk.java

As some of the optimization code lies with sentry-native now, a version bump of sentry-native-ndk is required as well.

💡 Motivation and Context

No degration in NDK init performance for 8.x.x

💚 How did you test it?

Manually double checked 16kb alignment using the official check_elf_alignment.sh script

./check_elf_alignment.sh sentry-samples-android-debug.apk

Recursively analyzing sentry-samples-android-debug.apk

NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher.
  You can install the latest build-tools by running the below command
  and updating your $PATH:

    sdkmanager "build-tools;35.0.0-rc3"

=== ELF alignment ===
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/armeabi-v7a/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/armeabi-v7a/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/armeabi-v7a/libnative-sample.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86/libnative-sample.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/arm64-v8a/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/arm64-v8a/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/arm64-v8a/libnative-sample.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86_64/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86_64/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/9d/kv_9v4115l79s8hxbvlrqwsc0000gn/T/sentry-samples-android-debug_out_XXXXX.qfDwmu2goN/lib/x86_64/libnative-sample.so: \e[32mALIGNED\e[0m (2**14)
ELF Verification Successful

📝 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 sendDefaultPII is 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.

🔮 Next steps

#skip-changelog

@github-actions
Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 410.39 ms 446.74 ms 36.35 ms
Size 1.65 MiB 2.31 MiB 675.37 KiB

@markushi markushi merged commit dc2af27 into 8.x.x Nov 21, 2024
@markushi markushi deleted the chore/bump-sentry-ndk branch November 21, 2024 10:51
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.

2 participants