RenderScript vs. NDK

Both RenderScript and NDK are here to improve the performance of applications. While they share a common goal, you should think carefully about using one versus the other. Each has its own advantages and drawbacks, and not thinking things through could result in you being stuck during development or finding out the hard way that something is extremely difficult to implement.

The advantages of RenderScript can be summarized as follows:

  • Platform-independent (ARM, MIPS, Intel, for example)
  • Easy parallel execution
  • Can use CPU, GPU, or other processing units

On the other hand, RenderScript does have some drawbacks:

  • Android-only (scripts cannot be used with other platforms like iOS)
  • Learning curve
  • Limited number of APIs

Actual RenderScript performance results are hard to obtain as they will heavily depend on the Android version and the hardware device. Some scripts may run much faster than their Java or NDK counterpart while others may not. Because of legacy code or because it simply makes sense in your application, you can actually use both RenderScript and the NDK in the same application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.57.219