Button Pusher • 2 HN points • 20 Mar 24
- Using C++ in Android can offer potential performance gains due to lower-level system access and existing libraries.
- Communication between Kotlin and C++ through the JNI comes with a cost, with rough estimates ranging from ~0 to ~104ns on modern devices, and additional costs for operations like sending integer arrays.
- For heavier workloads on large amounts of data, utilizing C++ for tasks like sorting an array or modifying elements can lead to significant performance improvements compared to Kotlin.