perf: Simplify generic type parameters in performance entry points#1426
Merged
makubacki merged 1 commit intoMar 24, 2026
Merged
Conversation
Closes OpenDevicePartnership#750 Reduces the number of generic type parameters in performance component functions by dropping the BB/B and RR/R indirection pattern. That pattern used a wrapper type (BB: AsRef<B>) alongside its underlying trait (B: BootServices). The AsRef indirection is not needed since StandardBootServices and MockBootServices both implement BootServices + Clone. - _entry_point from 6 generics (BB, B, RR, R, P, F) to 4 (B, R, P, F) - report_fbpt_record_buffer from 5 generics (BB, B, RR, R, F) to 3 (B, R, F) - fetch_and_add_mm_performance_records from 3 generics (BB, B, F) to 2 (B, F) - MmPerformanceEventContext from 3 generics (BB, B, F) to 2 (B, F) Also: - Replaces .as_ref().method() calls with direct .method() calls - Replaces BB::clone(&x) with x.clone() - Removes Rc wrapping from performance tests Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Contributor
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/23465841265 Boot Time to EFI Shell
Dependencies
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
os-d
approved these changes
Mar 24, 2026
Javagedes
approved these changes
Mar 24, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Closes #750
Reduces the number of generic type parameters in performance component functions by dropping the
BB/BandRR/Rindirection pattern.That pattern used a wrapper type (
BB: AsRef<B>) alongside its underlying trait (B: BootServices). TheAsRefindirection is not needed sinceStandardBootServicesandMockBootServicesboth implementBootServices + Clone.Generic reductions:
_entry_point()from 6 generics (BB, B, RR, R, P, F) to 4 (B, R, P, F)report_fbpt_record_buffer()from 5 generics (BB, B, RR, R, F) to 3 (B, R, F)fetch_and_add_mm_performance_records()from 3 generics (BB, B, F) to 2 (B, F)MmPerformanceEventContext()from 3 generics (BB, B, F) to 2 (B, F)Also:
.as_ref().method()calls withdirect .method()callsBB::clone(&x)withx.clone()Rcwrapping from performance testsHow This Was Tested
cargo make allIntegration Instructions
Note: This is to close an old backlog item as mentioned in the link GitHub issue.