Skip to content
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

[Rebase & FF] 202405: BaseTools/WinRcPath: Improve Performance. #903

Merged

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Jun 11, 2024

Description

WinRcPath generally takes about 2 seconds to run, due to calling multiple .bat files behind the scenes. This change reduces this time to ~0 seconds due to the following changes:

  1. It will attempt to load the path from the cache, which is located a $(WORKSPACE)/Conf/.rc_path. If the loading is a success and the rc_path still exists, it will use it.

  2. If the cache did not exist, or the path provided by the cache does not exist, it will find the rc path via the .bat files. If that succeeds, it will write the path to the cache.

Cherry-Pick and squash the following commits:

fe9fc525d9

  • 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. Confirmed the plugin will create a cache file on first run and use itin later runs
  2. Confirmed updating the path in the cache to a wrong value will invoke the typical means to find the cache and save the correct path into the cache.

Integration Instructions

N/A

@apop5 apop5 changed the title BaseTools/WinRcPath: Improve Performance. [Rebase & FF] 202405: BaseTools/WinRcPath: Improve Performance. Jun 13, 2024
WinRcPath generally takes about 2 seconds to run, due to calling
multiple .bat files behind the scenes. This change reduces this time to
~0 seconds due to the following changes:

1. It will attempt to load the path from the cache, which is located a
$(WORKSPACE)/Conf/.rc_path. If the loading is a success and the rc_path
still exists, it will use it.

2. If the cache did not exist, or the path provided by the cache does
not exist, it will find the rc path via the .bat files. If that
succeeds, it will write the path to the cache.
@apop5 apop5 force-pushed the personal/apop5/winrcimprovement branch from abbb272 to dab22b3 Compare June 26, 2024 03:48
@github-actions github-actions bot added the language:python Pull requests that update Python code label Jun 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/202405@e438f25). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202405     #903   +/-   ##
=================================================
  Coverage                  ?    1.33%           
=================================================
  Files                     ?     1433           
  Lines                     ?   359398           
  Branches                  ?     4581           
=================================================
  Hits                      ?     4792           
  Misses                    ?   354547           
  Partials                  ?       59           
Flag Coverage Δ
MdeModulePkg 0.32% <ø> (?)
MdePkg 5.41% <ø> (?)
NetworkPkg 0.55% <ø> (?)
UefiCpuPkg 4.80% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@makubacki makubacki requested a review from Javagedes June 26, 2024 14:42
@Javagedes
Copy link
Contributor

@apop5 you accidently added a step 3 in your PR description

@apop5 apop5 merged commit 6b5694d into microsoft:release/202405 Jul 9, 2024
36 checks passed
os-d pushed a commit to os-d/mu_basecore that referenced this pull request Jul 16, 2024
…osoft#903)

## Description

WinRcPath generally takes about 2 seconds to run, due to calling
multiple .bat files behind the scenes. This change reduces this time to
~0 seconds due to the following changes:

1. It will attempt to load the path from the cache, which is located a
$(WORKSPACE)/Conf/.rc_path. If the loading is a success and the rc_path
still exists, it will use it.

2. If the cache did not exist, or the path provided by the cache does
not exist, it will find the rc path via the .bat files. If that
succeeds, it will write the path to the cache.

## Cherry-Pick and squash the following commits:
[fe9fc52](microsoft@fe9fc525d9)

- [x] 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. Confirmed the plugin will create a cache file on first run and use
itin later runs
2. Confirmed updating the path in the cache to a wrong value will invoke
the typical means to find the cache and save the correct path into the
cache.

## Integration Instructions

N/A

Co-authored-by: Joey Vagedes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language:python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants