上游 · Kotlin/Native binary options
preCodegenInlineThreshold:Configures inlining optimization pass in the Kotlin IR compiler before code generation (disabled by default). The recommended number of tokens is 40.
全部配置 / KN-BINARY-PRECODEGENINLINETHRESHOLD
Xbinary=preCodegenInlineThreshold · KN-BINARY-PRECODEGENINLINETHRESHOLD · 编译器参数(Native)
默认值:未设置。未在规则表中给出消费默认。使用场合:场景可配。场景可配:有明确目标(性能、包体、安全、兼容)时再改。
用途。代码生成前内联阈值。示例取值:`preCodegenInlineThreshold=40`(建议约 40)。官方说明:Configures inlining optimization pass in the Kotlin IR compiler before code generation (disabled by default). The recommended number of tokens is 40.
影响。官方描述:Configures inlining optimization pass in the Kotlin IR compiler before code generation (disabled by default). The recommended number of tokens is 40. 变更后请在目标环境验证。
适用场景。场景可配。有明确需求再改,无需求时保持发行版默认更稳妥。改前核对目标限制与联动项,改后做冒烟。
可写。<非负整数> (非负整数(UIntValueParser:non-negative-number)。)
定义依据:konan/BinaryOptions.kt 在仓库中打开
// 文件:build.gradle.kts(应用的 Kotlin 模块,例如 composeApp)
kotlin {
ohosArm64 { // 按实际 native target 调整
binaries.all {
freeCompilerArgs += "-Xbinary=preCodegenInlineThreshold=40" // 建议约 40
}
}
}
不写这个配置时,编译器会怎么处理?
此选项默认未设置(空列表 / 空映射 / null)。不设置时由其他逻辑决定行为或直接跳过。
未在规则表中给出消费默认。
以下摘抄原文中与本配置最相关的段落,便于速读;完整上下文请点原文。
preCodegenInlineThreshold:Configures inlining optimization pass in the Kotlin IR compiler before code generation (disabled by default). The recommended number of tokens is 40.