diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt index 05b91ec5db0..65be6f61d5a 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt @@ -125,6 +125,7 @@ public open class K2JVMCompiler : CLICompiler() { if (arguments.script) { configuration.add(CommonConfigurationKeys.SCRIPT_DEFINITIONS_KEY, StandardScriptDefinition) + shouldReportPerf = false } putAdvancedOptions(configuration, arguments) @@ -232,6 +233,7 @@ public open class K2JVMCompiler : CLICompiler() { // allows to track GC time for each run when repeated compilation is used private val elapsedGCTime = hashMapOf() private var elapsedJITTime = 0L + private var shouldReportPerf = true public fun resetInitStartTime() { if (initStartNanos == 0L) { @@ -245,6 +247,8 @@ public open class K2JVMCompiler : CLICompiler() { } public fun reportPerf(configuration: CompilerConfiguration, message: String) { + if (!shouldReportPerf) return + val collector = configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY]!! collector.report(CompilerMessageSeverity.INFO, "PERF: " + message, CompilerMessageLocation.NO_LOCATION) }