report correct compiler init timings
This commit is contained in:
@@ -60,6 +60,7 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
|
||||
@SuppressWarnings("UnusedDeclaration") // Used via reflection in CompilerRunnerUtil#invokeExecMethod
|
||||
@NotNull
|
||||
public ExitCode execAndOutputXml(@NotNull PrintStream errStream, @NotNull Services services, @NotNull String... args) {
|
||||
K2JVMCompiler.Companion.resetInitStartTime();
|
||||
return exec(errStream, services, MessageRenderer.XML, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,8 +207,11 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
private fun createCoreEnvironment(rootDisposable: Disposable, configuration: CompilerConfiguration): KotlinCoreEnvironment {
|
||||
val result = KotlinCoreEnvironment.createForProduction(rootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
|
||||
val initNanos = System.nanoTime() - initStartNanos
|
||||
reportPerf(configuration, "INIT: Compiler initialized in " + TimeUnit.NANOSECONDS.toMillis(initNanos) + " ms")
|
||||
if (initStartNanos != 0L) {
|
||||
val initNanos = System.nanoTime() - initStartNanos
|
||||
reportPerf(configuration, "INIT: Compiler initialized in " + TimeUnit.NANOSECONDS.toMillis(initNanos) + " ms")
|
||||
initStartNanos = 0L
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -230,7 +233,9 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
private var elapsedJITTime = 0L
|
||||
|
||||
public fun resetInitStartTime() {
|
||||
initStartNanos = System.nanoTime()
|
||||
if (initStartNanos == 0L) {
|
||||
initStartNanos = System.nanoTime()
|
||||
}
|
||||
}
|
||||
|
||||
platformStatic public fun main(args: Array<String>) {
|
||||
|
||||
Reference in New Issue
Block a user