forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up SuperPMI mcs remove dup process (dotnet#33946)
* Speed up SuperPMI `mcs -removeDup` Create a "Hash" class that encapsulates the MD5 hashing that is used to determine if two MCs are equivalent. Primarily, this allows caching the Windows Crypto provider, which it is very slow to acquire. In addition, make some changes to avoid unnecessary memory allocations and other unnecessary work. The result is that `mcs -removeDup` is about 4x faster. Much of the remaining cost is that we read, deserialize the MC, then reserialize the MC (if unique), and finally destroy the in-memory MC. There is a lot of memory allocation/deallocation in this process that could possibly be avoided or improved for this scenario. * Factor out remove dup code to a separate class * Add new RemoveDup class * Add `-dedup` deduplication to `mcs -merge` Also add `-thin`. With this, ``` mcs.exe -merge base.mch *.mc -recursive mcs.exe -removeDup -thin base.mch nodup.mch ``` can be replaced with: ``` mcs.exe -merge -recursive -dedup -thin nodup.mch *.mc ``` The main benefit is avoiding creating a potentially very large base.mch file. Related, the data being processed only needs to be loaded once. * Fix Linux build break * Adjust tools to use new `mcs -merge -dedup -thin` arguments Adjust superpmi.py script and superpmicollect.cs unit test. * Update readme documentation for SuperPMI Add description of `mcs -merge -dedup -thin` arguments and usage.
- Loading branch information
1 parent
8cfcd8c
commit bd30e15
Showing
22 changed files
with
704 additions
and
316 deletions.
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
Oops, something went wrong.