examples : Improved inference performance of Android example project (#3913)

* fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android example

* fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android.java example
This commit is contained in:
Yongmin Yoo 유용민
2026-06-30 19:12:04 +09:00
committed by GitHub
parent 0ae02cdb2c
commit 65dc3fece6
2 changed files with 25 additions and 0 deletions

View File

@@ -25,6 +25,18 @@ android {
}
buildTypes {
debug {
externalNativeBuild {
cmake {
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
// compiler optimizations by default, causing a critical performance issue.
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
// even in Debug AGP builds.
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}
release {
signingConfig signingConfigs.debug
minifyEnabled true

View File

@@ -22,12 +22,25 @@ android {
}
buildTypes {
debug {
externalNativeBuild {
cmake {
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
// compiler optimizations by default, causing a critical performance issue.
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
// even in Debug AGP builds.
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}
release {
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17