Closed Kesanov closed 2 years ago
Can I asume it is related to this? https://github.com/korlibs/korio/issues/138
No, I have fixed 138 in my app.
Used this code for testing:
import com.soywiz.klock.*
import com.soywiz.korge.*
import com.soywiz.korge.tween.*
import com.soywiz.korge.view.*
import com.soywiz.korim.color.*
import com.soywiz.korim.format.*
import com.soywiz.korio.*
import com.soywiz.korio.async.*
import com.soywiz.korio.file.*
import com.soywiz.korio.file.std.*
import com.soywiz.korio.stream.*
import com.soywiz.korma.geom.*
import com.soywiz.korma.interpolation.*
suspend fun main() = Korge(width = 512, height = 512, bgcolor = Colors["#2b2b2b"]) {
launch {
val outFolder = localCurrentDirVfs["build/outzip"].apply { mkdirs() }.jail()
localCurrentDirVfs["bedrock-server-1.17.31.01.zip"].openAsZip { zip ->
zip.listRecursiveSimple().map {
val file = outFolder[it.path.trimStart('\\').trimStart('/')]
val time = measureTime {
when {
it.isDirectory() -> file.mkdirs()
else -> it.copyTo(file)
}
}
println("$file -> $time")
}
}
}
val minDegrees = (-16).degrees
val maxDegrees = (+16).degrees
val image = image(resourcesVfs["korge.png"].readBitmap()) {
rotation = maxDegrees
anchor(.5, .5)
scale(.8)
position(256, 256)
}
while (true) {
image.tween(image::rotation[minDegrees], time = 1.seconds, easing = Easing.EASE_IN_OUT)
image.tween(image::rotation[maxDegrees], time = 1.seconds, easing = Easing.EASE_IN_OUT)
}
}
Now performance on K/N is much better. Will improve further after this: https://github.com/korlibs/korge/issues/696
This code will lag the UI, while reading the content of zip file: