Hello All One basic question I have. Can anyone pl...
# multiplatform
n
Hello All One basic question I have. Can anyone please help me to understand ? Is
.framework
file for iOS generating in Objective-C for KMM ? If yes is there difference in terms of performance wise if we compare with Swift ?
yes black 1
t
Hi @neerav, do you mean if a framework is slower dann Swift Code? It depends how performant your Swift code is 😉. The "problem" is not that it is a framework or Objective C (which tends to be faster than Swift), it's how good is the translation layer from KMM's Kotlin to Objective C. I would say, If you do not build the next super computing app, you can just rely on "it's fast enough".
n
Hey @Tobias I understand like KMM is generating in obj-c In general I just want to ask and understand like “framework file generated in Obj-C VS Swift” in terms of performance. and my question is not on specific swift code. But question is framework file which are generated from KMM kotlin code
t
In my understanding, the result in which objc or swift is compiled is the same.
like a bit code.
l
They all use LLVM to compile to machine code. The Kotlin runtime will add some overhead, since the cms gc should have more overhead than an ARC based one. Overall, I'd expect Kotlin to be somewhat slower, but have less of an effect than even having another app in the background.
n
So app in KMM would raise questions on app performance specifically for iOS?
l
I’m currently working on an app that requires high performance in KMM for work. We see no measurable performance impact, but we also worked hard to eliminate allocations (we did the same when the code was previously C) and we don’t have exceptions in the hot path. I’d recommend benchmarking it, but don’t expect to see major drops in performance unless your code is really heavy with allocations and exceptions.
n
@Landry Norris thanks for sharing info. 🙇