So I've tried out the 1.9.20-BETA and tested it ou...
# kotlin-native
So I've tried out the 1.9.20-BETA and tested it out with a OpenGL framework (Raylib), while surprisingly the version did bring some nice improvements, I've experienced quite a lot of pause time and it does feel a bit weird... You can see it in the video quite clearly how the whole context freezes for few seconds and return and the FPS counter increases. Now that didn't happen in 1.9.10 so I'm unsure if its my code (C Interop is heavily wrapped around, but again, this did not happen in earlier version) and the way everything is wrapped around or is it because it's still beta ofc.
I don't have an exact explanation for this problem, however I think it is caused by the GC, which starts cleaning more importantly longer when there are more objects to remove. From the last change log I can see Native. Runtime. Memory •
Kotlin/Native: track memory in big chunks in the GC scheduler •
Implement custom allocator for Kotlin/Native •
Kotlin/Native: concurrently process weak references in GC •
Kotlin/Native: parallel mark in GC So maybe the
Ah cool so it’s most likely the GC that’s causing it.
You can try to log the GC actions and put it here, see
Yeah gonna have to try it out because using 1.9.20-Beta has weirdly enough destroyed the performance on my laptop with Linux but macOS performance was better so I’m gonna try it out on it later when I’m back home
👍 1
yikes that's a lot Now even on my Mac the performance got worse... No clue how, when it was fine this morning
Copy code
[INFO][gc][tid#11085][3.600s] Epoch #1: Time to pause #1: 0 microseconds.
[INFO][gc][tid#11085][3.600s] Epoch #1: Mutators pause time #1: 2620 microseconds.
[INFO][gc][tid#11085][3.600s] Epoch #1: Finished. Total GC epoch time is 66667 microseconds.
[INFO][gc][tid#11085][3.600s] Epoch #1: Finalization is done in 25 microseconds after epoch end.
Unfortunately, I'm not a GC expert, but one (or the sum?) of those times could indicate how long the application had to be completely stopped for the cleanup to take place. Which explains the chopping/pausing animation.
Yeah it's huge
Compared to 1.9.20-Beta this is 1.9.10:
A much smaller heap memory usage. Total GC epoch time is smaller, but mutators pause is a bit higher
FYI: better to retest after will be fixed - may be it will help 🙂
👍 2
Fingers crossed it will be fixed and pushed for new beta version!
Just tried 1.9.20-Beta2 and can say a massive improvement, the FPS is rather stable until you hit 36's, then you have the sudden FPS drops and backs up again. Long and often world pauses still persist though. But the massive mem allocs are gone.
🎉 4
A small comparison. 15k bunny entities (on my Mac Studio m2 max) allocated with 1.9.10 (but no world freezes) while in 1.9.20-Beta2 we got 21k bunny entities. That is a massive jump. However, if the world freezes that still happen often won’t be fixed it will be impossible to use it