-
Notifications
You must be signed in to change notification settings - Fork 2
🩹 [Patch]: Module startup is faster and performance checks are reproducible #69
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
Merged
Marius Storhaug (MariusStorhaug)
merged 14 commits into
main
from
benchmark-module-performance
Jul 23, 2026
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b229c1a
⚡ [Performance]: Remove redundant command initialization
MariusStorhaug f3f481d
🧪 [Test]: Cover parallel module sessions
MariusStorhaug 85367ff
🧪 [Test]: Cover module initialization paths
MariusStorhaug 917fe7a
🧪 [Test]: Clarify native runtime coverage
MariusStorhaug dd229fb
🧪 [Test]: Cover runtime selection branches
MariusStorhaug 53cf06d
🧪 [Test]: Exercise missing Windows runtime branch
MariusStorhaug 0477be7
Add performance benchmark tools under tools/benchmark
MariusStorhaug d12640d
Optimize import-time initialization path
MariusStorhaug 77226c8
Document rationale for hardcoded crypto_box constants
MariusStorhaug 9868cff
🩹 [Patch]: Resolve benchmark script linter warnings
MariusStorhaug b59aab9
🩹 [Patch]: Wrap benchmark build-path assignments for lint
MariusStorhaug 71c6f86
⚙️ [Maintenance]: Update Process-PSModule workflow to v6.1.13
MariusStorhaug 44ebeec
Add .github/zensical.toml required by Process-PSModule v6.1.x
MariusStorhaug 96368f4
Remove legacy .github/mkdocs.yml — Zensical-only site pipeline
MariusStorhaug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| function Assert-SodiumNativeRuntime { | ||
| <# | ||
| .SYNOPSIS | ||
| Provides platform-specific diagnostics after Sodium native initialization fails. | ||
|
|
||
| .DESCRIPTION | ||
| Checks the Windows Visual C++ runtime after a native initialization exception and throws a targeted message when the required | ||
| runtime is unavailable. | ||
|
|
||
| .NOTES | ||
| This function only runs after native library loading fails, which cannot be reproduced safely after the library is loaded in the test process. | ||
| #> | ||
| [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute()] | ||
| [OutputType([void])] | ||
| [CmdletBinding()] | ||
| param() | ||
|
|
||
| process { | ||
| if ($IsWindows -and $script:ProcessArchitecture -in @('X64', 'X86')) { | ||
| $hasRuntime = Assert-VisualCRedistributableInstalled -Version '14.0' -Architecture $script:ProcessArchitecture | ||
| if (-not $hasRuntime) { | ||
| $message = "Sodium native initialization failed; the Visual C++ Redistributable for " + | ||
| "$($script:ProcessArchitecture) appears to be missing or below the required version." | ||
| throw $message | ||
| } | ||
| } | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| function Resolve-SodiumRuntimeIdentifier { | ||
| <# | ||
| .SYNOPSIS | ||
| Resolves the native Sodium runtime identifier. | ||
|
|
||
| .DESCRIPTION | ||
| Maps the active operating system and process architecture to the runtime identifier used by the bundled native library. | ||
| #> | ||
| [OutputType([string])] | ||
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(Mandatory)] | ||
| [System.Runtime.InteropServices.Architecture] $ProcessArchitecture, | ||
|
|
||
| [Parameter()] | ||
| [switch] $Linux, | ||
|
|
||
| [Parameter()] | ||
| [switch] $MacOS, | ||
|
|
||
| [Parameter()] | ||
| [switch] $Windows | ||
| ) | ||
|
|
||
| process { | ||
| switch ($true) { | ||
| $Linux { | ||
| switch ($ProcessArchitecture) { | ||
| 'Arm64' { return 'linux-arm64' } | ||
| 'X64' { return 'linux-x64' } | ||
| default { | ||
| $message = "Unsupported Linux process architecture: $ProcessArchitecture. " + | ||
| 'Please refer to the documentation for supported architectures.' | ||
| throw $message | ||
| } | ||
| } | ||
| } | ||
| $MacOS { | ||
| switch ($ProcessArchitecture) { | ||
| 'Arm64' { return 'osx-arm64' } | ||
| 'X64' { return 'osx-x64' } | ||
| default { | ||
| $message = "Unsupported macOS process architecture: $ProcessArchitecture. " + | ||
| 'Please refer to the documentation for supported architectures.' | ||
| throw $message | ||
| } | ||
| } | ||
| } | ||
| $Windows { | ||
| switch ($ProcessArchitecture) { | ||
| 'X64' { return 'win-x64' } | ||
| 'X86' { return 'win-x86' } | ||
| default { | ||
| $message = "Unsupported Windows process architecture: $ProcessArchitecture. " + | ||
| 'Please refer to the documentation for supported architectures.' | ||
| throw $message | ||
| } | ||
| } | ||
| } | ||
| default { | ||
| throw 'Unsupported platform. Please refer to the documentation for more information.' | ||
| } | ||
| } | ||
| } | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.