-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[PT Run] Improve the Win32 Program Indexing speed #11364
Merged
mykhailopylyp
merged 13 commits into
microsoft:master
from
royvou:feature/improvewin32scanningspeed
Jun 3, 2021
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
46ed995
Move Indexing Logic to Init
royvou 0714b82
Refactor Win32 indexing to prevent programs from being indexed twice …
royvou 1ea6788
Move "IsWebApplication" Check to Indexing
royvou 2b0761c
Implement Grouping by Group
royvou d67a5e9
Log security related exceptions as a warning
royvou b3fa3f8
Implement EqualityComparer
royvou 73c41ae
Add setenv
royvou 584dc30
- Add Static InvalidProgram (To reduce allocations)
royvou 457c0e3
Correctly resolve full program.ExecutableName
royvou ea41bb9
Change type to List
royvou 81d40ae
Add .ExecutableName?.ToUpperInvariant() to Win32ProgramEqualityComparer
royvou 92012eb
Rollback change with .lnk/exe (resolve winword)
royvou 0c95f42
Add translations
royvou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,20 +53,6 @@ public Main() | |
|
||
// Initialize the Win32ProgramRepository with the settings object | ||
_win32ProgramRepository = new Win32ProgramRepository(_win32ProgramRepositoryHelper.FileSystemWatchers.Cast<IFileSystemWatcherWrapper>().ToList(), new BinaryStorage<IList<Programs.Win32Program>>("Win32"), Settings, _win32ProgramRepositoryHelper.PathsToWatch); | ||
|
||
var a = Task.Run(() => | ||
{ | ||
Stopwatch.Normal("Microsoft.Plugin.Program.Main - Win32Program index cost", _win32ProgramRepository.IndexPrograms); | ||
}); | ||
|
||
var b = Task.Run(() => | ||
{ | ||
Stopwatch.Normal("Microsoft.Plugin.Program.Main - Package index cost", _packageRepository.IndexPrograms); | ||
}); | ||
|
||
Task.WaitAll(a, b); | ||
|
||
Settings.LastIndexTime = DateTime.Today; | ||
} | ||
|
||
public void Save() | ||
|
@@ -118,6 +104,20 @@ public void Init(PluginInitContext context) | |
_context.API.ThemeChanged += OnThemeChanged; | ||
|
||
UpdateUWPIconPath(_context.API.GetCurrentTheme()); | ||
|
||
var a = Task.Run(() => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved from Constructor to Initialize method so it won't run if you disable the program plugin |
||
{ | ||
Stopwatch.Normal("Microsoft.Plugin.Program.Main - Win32Program index cost", _win32ProgramRepository.IndexPrograms); | ||
}); | ||
|
||
var b = Task.Run(() => | ||
{ | ||
Stopwatch.Normal("Microsoft.Plugin.Program.Main - Package index cost", _packageRepository.IndexPrograms); | ||
}); | ||
|
||
Task.WaitAll(a, b); | ||
|
||
Settings.LastIndexTime = DateTime.Today; | ||
} | ||
|
||
public void OnThemeChanged(Theme currentTheme, Theme newTheme) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Added Warn Method which could be used for non-fatal index related issues (e.g. Not found / not accessible / not parse able)