Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FlattenPdbs: improve performance (microsoft#511)
## Description FlattenPdbs generally takes anywhere from .8 to 1.5 seconds for a given platform. This change reduces this time to .3 to .4 seconds due to the following changes: 1. Only copy pdbs in the the OUTPUT folder. The original code did not check what folder the pdb was in, and would copy the same pdb multiple times due to the same file siting in OUTPUT and DEBUG folders. 2. Performs a hardlink rather than copying the file. This improves performance as a hardlink is treated as it's own file, but points the same physical file on disk. This means we create just the file metadata, and don't need to copy the data the file contains. A reference counter ensures that deleting the file in one place does not not delete the file on disk (unless it is the last reference), so the other hardlinks are not affected. 3. The above change also allows the code to check the ino value (a unique identifier for a file on disk) and skip the making of a hardlink if it is already linked. This is a small optimization as running a build only rebuilds modules that have changed. - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested 1. Verified performance improvements 2. Verified non-changed files are not copied to the bdb folder 3. verified changed files are copied to the pdb folder 4. Verified files deleted in the pdb folder are replaced ## Integration Instructions N/A
- Loading branch information