Search code examples
android-studiobuildrenderscript

What is “Rendercript Optim Level”?


Android Studio --> Open Module Settings --> Build Types --> Renderscript Optim Level --> (3) // by default

What is "Rendercript Optim Level" best value?


Solution

  • It's best to use the default "optim" level 3.

    In the renderscript source, level 3 corresponds to the value llvm::CodeGenOpt::Aggressive in the slang compiler.

    It's the argument that sets the level of optimization slang uses to compile the .rs file into the intermediate bitcode (.bc) file that get shipped with your app.

    Interestingly, the optim level is included in the script's .bc file, but ignored by the bcc compiler that finishes preparing the script on the device. It just discards the value and sets it to llvm::CodeGenOpt::Aggressive no matter what.

    sources:

    Where is the RenderScript source code