hello all, I’ve just tested the `smallBinary` fea...
# kotlin-native
c
hello all, I’ve just tested the
smallBinary
feature released on 2.2.20-Beta1 but I didn’t noticed any change on the frameworks size; I’ve tested both added on
gradle.properties
and on
build.gradle.kts
. Am I missing something? 🤔
s
Hey! Did you try it in release or debug mode?
c
hello Sergey, I’ve tested it in release
s
That’s interesting! Could you please add
-Xverbose-phases=ModuleBitcodeOptimization
to
freeCompilerArgs
and share the stdout? It should be something like
Copy code
Running New PM Module LLVM optimizations with the following parameters:
target_triple: x86_64-unknown-linux-gnu
cpu_model: x86-64
cpu_features: +cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87
optimization_level: 3
size_level: 2
inline_threshold: 100
passes: default<Oz>
c
I’m assuming it should be the
optimization_level
parameter, no? I’ve got it set both on gradle.properties and on the release frameworks.
Copy code
Running New PM Module LLVM optimizations with the following parameters:
> Task :shield:linkDebugFrameworkIosSimulatorArm64
target_triple: arm64-apple-ios14.0.0-simulator
cpu_model: apple-m1
cpu_features: +aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz
optimization_level: 0
size_level: 0
inline_threshold: default
passes: default<O0>
This is from the debug build. I’m generating now for release.
In release the
optimization_level
is 2:
Copy code
> Task :shield:linkReleaseFrameworkIosX64
Running New PM Module LLVM optimizations with the following parameters:
target_triple: x86_64-apple-ios12.0.0-simulator
cpu_model: core2
cpu_features: +cmov,+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+ssse3,+x87
optimization_level: 3
size_level: 2
inline_threshold: 100
passes: default<Oz>
s
size_level and passes are the relevant ones. As far as I can see, smallBinary is indeed passed to the compilation pipeline in the release mode (size_level is 2 and Oz passes). That’s the start! Now just to confirm your observations: could you please share the compilation timings with and without smallBinary? You can get them by passing -Xprofile-phases to freeCompilerArgs.