Summary
Review whether using direct assembly load (Add-Type -Path / Assembly.LoadFrom) is faster than Import-Module for loading the managed interop DLL.
Why
Import-Module performs module discovery/metadata work that may add avoidable cold-start overhead when only an assembly load is needed in this step.
Proposed change
- Benchmark current
Import-Module load path vs direct assembly load approach.
- Keep module UX and command export behavior unchanged.
- Adopt the fastest safe strategy and document rationale.
Acceptance criteria
- Cold-start path measured before/after with repeatable benchmark script.
- No change to public command availability.
- Existing tests pass.
- Chosen approach documented in code comments or contributor docs.
Summary
Review whether using direct assembly load (
Add-Type -Path/Assembly.LoadFrom) is faster thanImport-Modulefor loading the managed interop DLL.Why
Import-Moduleperforms module discovery/metadata work that may add avoidable cold-start overhead when only an assembly load is needed in this step.Proposed change
Import-Moduleload path vs direct assembly load approach.Acceptance criteria