[K2] Move Generation perf calculation inside generateCodeFromIr
1. We don't need to include `GenerationState` initialization time 2. We don't need to include diagnostic reporting time
This commit is contained in:
-3
@@ -158,7 +158,6 @@ object FirKotlinToJvmBytecodeCompiler {
|
|||||||
val fir2IrAndIrActualizerResult =
|
val fir2IrAndIrActualizerResult =
|
||||||
firResult.convertToIrAndActualizeForJvm(fir2IrExtensions, configuration, diagnosticsReporter, irGenerationExtensions)
|
firResult.convertToIrAndActualizeForJvm(fir2IrExtensions, configuration, diagnosticsReporter, irGenerationExtensions)
|
||||||
|
|
||||||
performanceManager?.notifyGenerationStarted()
|
|
||||||
val generationState = runBackend(
|
val generationState = runBackend(
|
||||||
fir2IrExtensions,
|
fir2IrExtensions,
|
||||||
fir2IrAndIrActualizerResult,
|
fir2IrAndIrActualizerResult,
|
||||||
@@ -167,8 +166,6 @@ object FirKotlinToJvmBytecodeCompiler {
|
|||||||
|
|
||||||
FirDiagnosticsCompilerResultsReporter.reportToMessageCollector(diagnosticsReporter, messageCollector, renderDiagnosticNames)
|
FirDiagnosticsCompilerResultsReporter.reportToMessageCollector(diagnosticsReporter, messageCollector, renderDiagnosticNames)
|
||||||
|
|
||||||
performanceManager?.notifyIRGenerationFinished()
|
|
||||||
performanceManager?.notifyGenerationFinished()
|
|
||||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||||
|
|
||||||
return firResult to generationState
|
return firResult to generationState
|
||||||
|
|||||||
@@ -136,16 +136,12 @@ fun compileModulesUsingFrontendIrAndLightTree(
|
|||||||
val compilerEnvironment = ModuleCompilerEnvironment(projectEnvironment, diagnosticsReporter)
|
val compilerEnvironment = ModuleCompilerEnvironment(projectEnvironment, diagnosticsReporter)
|
||||||
val irInput = convertAnalyzedFirToIr(compilerInput, analysisResults, compilerEnvironment)
|
val irInput = convertAnalyzedFirToIr(compilerInput, analysisResults, compilerEnvironment)
|
||||||
|
|
||||||
performanceManager?.notifyGenerationStarted()
|
|
||||||
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
||||||
|
|
||||||
diagnosticsReporter.reportToMessageCollector(
|
diagnosticsReporter.reportToMessageCollector(
|
||||||
messageCollector, moduleConfiguration.getBoolean(CLIConfigurationKeys.RENDER_DIAGNOSTIC_INTERNAL_NAME)
|
messageCollector, moduleConfiguration.getBoolean(CLIConfigurationKeys.RENDER_DIAGNOSTIC_INTERNAL_NAME)
|
||||||
)
|
)
|
||||||
|
|
||||||
performanceManager?.notifyIRGenerationFinished()
|
|
||||||
performanceManager?.notifyGenerationFinished()
|
|
||||||
|
|
||||||
return writeOutputsIfNeeded(
|
return writeOutputsIfNeeded(
|
||||||
project,
|
project,
|
||||||
compilerConfiguration,
|
compilerConfiguration,
|
||||||
@@ -236,6 +232,7 @@ fun generateCodeFromIr(
|
|||||||
environment.diagnosticsReporter
|
environment.diagnosticsReporter
|
||||||
).build()
|
).build()
|
||||||
|
|
||||||
|
performanceManager?.notifyGenerationStarted()
|
||||||
performanceManager?.notifyIRLoweringStarted()
|
performanceManager?.notifyIRLoweringStarted()
|
||||||
generationState.beforeCompile()
|
generationState.beforeCompile()
|
||||||
codegenFactory.generateModuleInFrontendIRMode(
|
codegenFactory.generateModuleInFrontendIRMode(
|
||||||
@@ -255,6 +252,9 @@ fun generateCodeFromIr(
|
|||||||
}
|
}
|
||||||
CodegenFactory.doCheckCancelled(generationState)
|
CodegenFactory.doCheckCancelled(generationState)
|
||||||
generationState.factory.done()
|
generationState.factory.done()
|
||||||
|
performanceManager?.notifyIRGenerationFinished()
|
||||||
|
|
||||||
|
performanceManager?.notifyGenerationFinished()
|
||||||
|
|
||||||
return ModuleCompilerOutput(generationState)
|
return ModuleCompilerOutput(generationState)
|
||||||
}
|
}
|
||||||
|
|||||||
-4
@@ -269,7 +269,6 @@ open class IncrementalFirJvmCompilerRunner(
|
|||||||
extensions, configuration, compilerEnvironment.diagnosticsReporter, irGenerationExtensions,
|
extensions, configuration, compilerEnvironment.diagnosticsReporter, irGenerationExtensions,
|
||||||
)
|
)
|
||||||
|
|
||||||
performanceManager?.notifyGenerationStarted()
|
|
||||||
val irInput = ModuleCompilerIrBackendInput(
|
val irInput = ModuleCompilerIrBackendInput(
|
||||||
targetId,
|
targetId,
|
||||||
configuration,
|
configuration,
|
||||||
@@ -282,9 +281,6 @@ open class IncrementalFirJvmCompilerRunner(
|
|||||||
|
|
||||||
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
||||||
|
|
||||||
performanceManager?.notifyIRGenerationFinished()
|
|
||||||
performanceManager?.notifyGenerationFinished()
|
|
||||||
|
|
||||||
diagnosticsReporter.reportToMessageCollector(messageCollector, renderDiagnosticName)
|
diagnosticsReporter.reportToMessageCollector(messageCollector, renderDiagnosticName)
|
||||||
|
|
||||||
writeOutputsIfNeeded(
|
writeOutputsIfNeeded(
|
||||||
|
|||||||
Reference in New Issue
Block a user