I've been playing around with Kotlin to solve some problems lately and the runtimes can get absurdly slow: think 500-2000 ms for a simple O(n) algorithm. Directly translating my algorithms into Java results in extremely quick runtimes for test cases, so I don't think the issue is my choice of algorithm.
What's causing this and how can I fix it?