https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
s

spierce7

03/18/2023, 2:49 PM
I'm having a performance issue on Windows for Kotlin Native. We have a small application in Kotlin Native that interacts with a C library to stream text to us. We provide the library a static c function, and it streams the log to us.
Copy code
staticCFunction { cByte, _ ->
            val c = cByte.toInt().toChar()
            print(c)
        }
The streaming gets backed up and starts to significantly lag on Windows Machines. The same code on Mac seems to perform fine. We've removed the print, and started buffering the characters before we print (so we only print once a line). The issue is still present. The same code in C++ doesn't have the same performance issues. What else could we do to improve performance in Kotlin?
5 Views