Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/jit-analyze/jit-analyze.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class Config
private bool _retainOnlyTopFiles = false;
private double? _overrideTotalBaseMetric;
private double? _overrideTotalDiffMetric;
private bool _isDiffsOnly = false;
private bool _isSubsetOfDiffs = false;

public Config(string[] args)
{
Expand Down Expand Up @@ -118,6 +120,10 @@ public Config(string[] args)
"Override the total base metric shown in the output with this value. Useful when only changed .dasm files are present and these values are known.");
syntax.DefineOption("override-total-diff-metric", ref _overrideTotalDiffMetric, ParseDouble,
"Override the total diff metric shown in the output with this value. Useful when only changed .dasm files are present and these values are known.");
syntax.DefineOption("is-diffs-only", ref _isDiffsOnly,
"Specify that the disassembly files are only produced for contexts with diffs, so avoid producing output making assumptions about the number of contexts.");
syntax.DefineOption("is-subset-of-diffs", ref _isSubsetOfDiffs,
"Specify that the disassembly files are only a subset of the contexts with diffs, so avoid producing output making assumptions about the remaining diffs.");
});

// Run validation code on parsed input to ensure we have a sensible scenario.
Expand Down Expand Up @@ -172,6 +178,8 @@ private void Validate()
public string Note { get { return _note; } }
public double? OverrideTotalBaseMetric => _overrideTotalBaseMetric;
public double? OverrideTotalDiffMetric => _overrideTotalDiffMetric;
public bool IsDiffsOnly => _isDiffsOnly;
public bool IsSubsetOfDiffs => _isSubsetOfDiffs;

public string Filter { get { return _filter; } }

Expand Down Expand Up @@ -1034,7 +1042,17 @@ void DisplayMethodMetric(string headerText, string subtext, int methodCount, dyn
DisplayMethodMetric("Top method regressions", "percentage", methodRegressionCount, sortedMethodRegressionsByPercentage);
DisplayMethodMetric("Top method improvements", "percentage", methodImprovementCount, sortedMethodImprovementsByPercentage);

summaryContents.AppendLine($"\n{sortedMethodCount} total methods with {metricDisplayName} differences ({methodImprovementCount} improved, {methodRegressionCount} regressed), {unchangedMethodCount} unchanged.");
if (!config.IsSubsetOfDiffs)
{
if (config.IsDiffsOnly)
{
summaryContents.AppendLine($"\n{sortedMethodCount} total methods with {metricDisplayName} differences ({methodImprovementCount} improved, {methodRegressionCount} regressed).");
}
else
{
summaryContents.AppendLine($"\n{sortedMethodCount} total methods with {metricDisplayName} differences ({methodImprovementCount} improved, {methodRegressionCount} regressed), {unchangedMethodCount} unchanged.");
}
}

if (!config.SkipTextDiff)
{
Expand Down