Skip to content

perf: Simplify generic type parameters in performance entry points#1426

Merged
makubacki merged 1 commit into
OpenDevicePartnership:mainfrom
makubacki:perf_component_entry_point_refactor
Mar 24, 2026
Merged

perf: Simplify generic type parameters in performance entry points#1426
makubacki merged 1 commit into
OpenDevicePartnership:mainfrom
makubacki:perf_component_entry_point_refactor

Conversation

@makubacki
Copy link
Copy Markdown
Collaborator

Description

Closes #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.

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:

  • Replaces .as_ref().method() calls with direct .method() calls
  • Replaces BB::clone(&x) with x.clone()
  • Removes Rc wrapping from performance tests

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • cargo make all
  • Q35 boot with performance component enabled

Integration Instructions

  • N/A

Note: This is to close an old backlog item as mentioned in the link GitHub issue.

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>
@makubacki makubacki self-assigned this Mar 23, 2026
@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented Mar 23, 2026

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/23465841265

Boot Time to EFI Shell

Platform Elapsed
Q35 (Linux Host) 28.8s
SBSA (Linux Host) 35.6s

Dependencies

Repository Ref
patina b0a813b
patina-dxe-core-qemu 4f98fff
patina-fw-patcher 3b8900d
patina-qemu firmware v2.0.0
patina-qemu build script b20729a

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added the impact:non-functional Does not have a functional impact label Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki makubacki merged commit b45ef14 into OpenDevicePartnership:main Mar 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Reduce complex interfaces in perf code

3 participants