[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 =
|
||||
firResult.convertToIrAndActualizeForJvm(fir2IrExtensions, configuration, diagnosticsReporter, irGenerationExtensions)
|
||||
|
||||
performanceManager?.notifyGenerationStarted()
|
||||
val generationState = runBackend(
|
||||
fir2IrExtensions,
|
||||
fir2IrAndIrActualizerResult,
|
||||
@@ -167,8 +166,6 @@ object FirKotlinToJvmBytecodeCompiler {
|
||||
|
||||
FirDiagnosticsCompilerResultsReporter.reportToMessageCollector(diagnosticsReporter, messageCollector, renderDiagnosticNames)
|
||||
|
||||
performanceManager?.notifyIRGenerationFinished()
|
||||
performanceManager?.notifyGenerationFinished()
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||
|
||||
return firResult to generationState
|
||||
|
||||
@@ -136,16 +136,12 @@ fun compileModulesUsingFrontendIrAndLightTree(
|
||||
val compilerEnvironment = ModuleCompilerEnvironment(projectEnvironment, diagnosticsReporter)
|
||||
val irInput = convertAnalyzedFirToIr(compilerInput, analysisResults, compilerEnvironment)
|
||||
|
||||
performanceManager?.notifyGenerationStarted()
|
||||
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
||||
|
||||
diagnosticsReporter.reportToMessageCollector(
|
||||
messageCollector, moduleConfiguration.getBoolean(CLIConfigurationKeys.RENDER_DIAGNOSTIC_INTERNAL_NAME)
|
||||
)
|
||||
|
||||
performanceManager?.notifyIRGenerationFinished()
|
||||
performanceManager?.notifyGenerationFinished()
|
||||
|
||||
return writeOutputsIfNeeded(
|
||||
project,
|
||||
compilerConfiguration,
|
||||
@@ -236,6 +232,7 @@ fun generateCodeFromIr(
|
||||
environment.diagnosticsReporter
|
||||
).build()
|
||||
|
||||
performanceManager?.notifyGenerationStarted()
|
||||
performanceManager?.notifyIRLoweringStarted()
|
||||
generationState.beforeCompile()
|
||||
codegenFactory.generateModuleInFrontendIRMode(
|
||||
@@ -255,6 +252,9 @@ fun generateCodeFromIr(
|
||||
}
|
||||
CodegenFactory.doCheckCancelled(generationState)
|
||||
generationState.factory.done()
|
||||
performanceManager?.notifyIRGenerationFinished()
|
||||
|
||||
performanceManager?.notifyGenerationFinished()
|
||||
|
||||
return ModuleCompilerOutput(generationState)
|
||||
}
|
||||
|
||||
-4
@@ -269,7 +269,6 @@ open class IncrementalFirJvmCompilerRunner(
|
||||
extensions, configuration, compilerEnvironment.diagnosticsReporter, irGenerationExtensions,
|
||||
)
|
||||
|
||||
performanceManager?.notifyGenerationStarted()
|
||||
val irInput = ModuleCompilerIrBackendInput(
|
||||
targetId,
|
||||
configuration,
|
||||
@@ -282,9 +281,6 @@ open class IncrementalFirJvmCompilerRunner(
|
||||
|
||||
val codegenOutput = generateCodeFromIr(irInput, compilerEnvironment, performanceManager)
|
||||
|
||||
performanceManager?.notifyIRGenerationFinished()
|
||||
performanceManager?.notifyGenerationFinished()
|
||||
|
||||
diagnosticsReporter.reportToMessageCollector(messageCollector, renderDiagnosticName)
|
||||
|
||||
writeOutputsIfNeeded(
|
||||
|
||||
Reference in New Issue
Block a user