https://kotlinlang.org logo
#android
Title
# android
r

Raghav

03/19/2024, 12:27 PM
Hey guys, can you recommend any resource from where I can better understand meaning and significance of different keywords appearing in the generated Kotlin Bytecode such as ALOAD, ASTORE, LDC etc. Thanks. I'm trying to find an answer to a question that does having many classes (all classes are used or referenced somewhere) deteriorate the performance of an android app? The preliminary step I'm taking is to look at the bytecode as I'm assuming that more the number of instructions in the generated bytecode less performant will the app get. Thanks
not kotlin but kotlin colored 2
c

Chrimaeon

03/19/2024, 12:37 PM
That bytecode is not Kotlin‘s but Java‘s https://en.wikipedia.org/wiki/List_of_Java_bytecode_instructions
r

Raghav

03/19/2024, 12:39 PM
Oh i should have searched in Java's reference got it. thanks!
e

ephemient

03/19/2024, 2:10 PM
also no your assumption is wrong
Java HotSpot JIT optimizes a whole function at a time, including recognizing sequences of multiple bytecode operations that can be performed in a different number of native operations. the number of bytecode instructions has little bearing on the performance
also they don't get mapped 1:1 to Dalvik bytecode which is what actually ends up on Android devices
then ART's optimizations are also not translating that 1:1 to native instructions either
if you want to measure performance, you have to actually measure performance
1
r

Raghav

03/20/2024, 5:53 AM
thanks for the info, but a significant difference in the number of bytecode instructions would definitely be reflected in the performance right?
e

ephemient

03/20/2024, 8:37 AM
depends on the instructions
r

Raghav

03/20/2024, 9:07 AM
ok