Hey, I've tried to replace logic for AST to text generation from string concatenation to a common stringbuilder, but it gave only about 5% boost. It's available here:
https://github.com/krzema12/kotlin-python/tree/2021-07-30-stringbuilder
I wasn't able to profile a test run. It seems profiling isn't available in IDEA for test tasks. We can still try profile running profiler manually somehow. Another thing I've tried is to convert test source root to main, but I've stuck with some error related to unavailable IDEA installation required by calls to IDEA logger and other classes.
I think I will shelve the task of optimizing tests for now. Will continue with box tests themselves