Benchmarking in Native
With Co-routine in native
package com.thorg.cli.subcommands
import com.thorg.ThorgClient
import io.micronaut.configuration.picocli.PicocliRunner
import kotlinx.coroutines.runBlocking
import picocli.CommandLine
import java.util.concurrent.Callable
import javax.inject.Inject
import kotlin.system.exitProcess
@CommandLine.Command(
name = "simple",
mixinStandardHelpOptions = true,
)
class Simple : Callable<Int> {
override fun call(): Int {
return runBlocking {
suspendingCall()
}
}
private suspend fun suspendingCall(): Int {
println("Hello from suspendingCall")
return 0
}
companion object {
@Throws(Exception::class)
@JvmStatic
fun main(args: Array<String>) {
exitProcess(PicocliRunner.execute(Lookup::class.java, *args))
}
}
}
real 0m0.036s
user 0m0.014s
sys 0m0.022s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.035s
user 0m0.014s
sys 0m0.019s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.033s
user 0m0.013s
sys 0m0.019s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.032s
user 0m0.014s
sys 0m0.015s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.034s
user 0m0.014s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.033s
user 0m0.014s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.032s
user 0m0.013s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.121s
user 0m0.011s
sys 0m0.046s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.035s
user 0m0.014s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.039s
user 0m0.015s
sys 0m0.020s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.031s
user 0m0.014s
sys 0m0.016s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.034s
user 0m0.014s
sys 0m0.020s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.031s
user 0m0.014s
sys 0m0.017s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" simple
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Hello from suspendingCall
real 0m0.031s
user 0m0.014s
sys 0m0.017s
Versus another simple command
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.031s
user 0m0.014s
sys 0m0.015s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.032s
user 0m0.014s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.031s
user 0m0.014s
sys 0m0.015s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.032s
user 0m0.014s
sys 0m0.016s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.031s
user 0m0.013s
sys 0m0.015s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.031s
user 0m0.014s
sys 0m0.017s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.033s
user 0m0.014s
sys 0m0.018s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.032s
user 0m0.014s
sys 0m0.017s
mac> time "${THORG_CLI_NATIVE_IMAGE:?}" lookup
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Doing something from MySingletonSingletonService.
real 0m0.032s
user 0m0.014s
sys 0m0.019s1