From a9c18226a8563339792d54832e7156a87d531269 Mon Sep 17 00:00:00 2001 From: Tomas Rylek Date: Tue, 14 Jun 2022 17:55:20 +0200 Subject: [PATCH] Fix AttributePresence in composite mode According to my comparative perf measurements composite framework spends about 5M more instructions in the method coreclr.dll!CMiniMdTemplate::SearchTableForMultipleRows(CMiniColDef sColumn) I tracked this down to the R2R table AttributePresence which is used to speed up attribute queries against the ECMA metadata model. In composite mode we were putting the table in the image header, not component header, and so the runtime was unable to locate it. This change fixes generation of the table in Crossgen2; I have verified that with this change I no longer see the 5M outlier. Thanks Tomas --- .../Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs index 550b4e451adc0d..44925d84cfe21c 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs @@ -663,7 +663,7 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph) if (inputModule == TypeSystemContext.SystemModule) { AttributePresenceFilterNode attributePresenceTable = new AttributePresenceFilterNode(inputModule); - Header.Add(Internal.Runtime.ReadyToRunSectionType.AttributePresence, attributePresenceTable, attributePresenceTable); + tableHeader.Add(Internal.Runtime.ReadyToRunSectionType.AttributePresence, attributePresenceTable, attributePresenceTable); } }