This works through JNI. It will work fine as long as you don't use Java/Kotlin stuff. Then you will need to traverse back into the running VM. That has a serious overhead of going in/out of the VM. Since the Android UI is built in Java C code that tries to work with it is slower.
Notice that this isn't true for games which interact with the hardware directly in C. Only for high level UI stuff.