-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling multithread analysis #495
Conversation
@@ -153,7 +153,7 @@ private AnalysisSummary ExtractAnalysisSummary(SarifLog sarifLog, AnalyzeOptions | |||
NormalizedPath = string.Join(";", options.TargetFileSpecifiers.Select(p => System.IO.Path.GetDirectoryName(p)).Distinct()), | |||
SymbolPath = options.SymbolsPath, | |||
FileAnalyzed = artifacts.Count, | |||
// FileNotAnalyzed = | |||
// FileNotAnalyzed = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PropertiesDictionary configData = policy.GetProperty(MitigatedCompilers); | ||
foreach (string key in configData.Keys) | ||
{ | ||
var machine = (MachineFamily)Enum.Parse(typeof(MachineFamily), key); // Neaten this up. | ||
compilerData.Add(machine, CreateSortedVersionDictionary((PropertiesDictionary)configData[key])); | ||
compilerData.TryAdd(machine, CreateSortedVersionDictionary((PropertiesDictionary)configData[key])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think so.
Once the first thread or first analysis pass in the compilerData, the object would not be null and that path wouldn't pass anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this change I'm enabling multithreading analysis, updating sarif-sdk submodules to the latest version, which contains the relevant changes to enable multithreading + hashing.
The multithreading starts reading files as an IEnumerable and adds those files to the processing channels.
If hashing is enabled, it would prevent doing the same analysis twice.