Perf - #13
Merged
Merged
Perf#13
Conversation
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
…cs-gathering Disable benchmark metrics and consolidate performance comparisons
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Make engine retries verifiable and centralize metadata recovery
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
Expand perf workflow to benchmark `perf` with and without `DISABLE_ENGINE_RETRIES`
Co-authored-by: jessehouwing <4173387+jessehouwing@users.noreply.github.com>
…isons Restore benchmark comparisons and explicit retry variants
- Drop retry loops and DISABLE_ENGINE_RETRIES flag from CommandInfoCache; failed lookups evict the cache entry and return null gracefully - Delete PerformanceTelemetry and all metrics collection from the engine, benchmark harness, workflows and tests - Refactor GetCommandMetadata to Func<CommandInfo, T> - Add lookup-count and module-qualified resolution tests - Rework Issue2205 repro into generic ParallelRuleExecution test with a bounded synthetic workload, no Linux filter Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benchmark now compares upstream@main against fork@main only, in preparation for merging the perf branch to main. Also makes source a proper matrix dimension. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This pull request makes significant improvements to the
CommandInfoCacheand related command metadata handling in the ScriptAnalyzer engine. The main focus is on thread safety, improved caching, and more robust handling of PowerShell command metadata, especially for parameter information. It introduces a newCommandParameterSnapshotclass to safely cache detached parameter metadata, and it refactors how command and parameter information is retrieved and cached to avoid threading issues with the PowerShell engine.Thread safety and runspace management:
CommandInfoCacheto use a singleRunspaceand a re-entrant lock (_runspaceLock) instead of aRunspacePool, ensuring all PowerShell engine access is serialized and thread-safe. This prevents transient failures due to PowerShell's lack of thread safety. [1] [2]Command and parameter metadata caching:
CommandParameterSnapshotclass to safely store and retrieve parameter facts without needing to access PowerShell runspace objects, avoiding runspace affinity issues.Improved error handling and cache eviction:
Helper and analysis improvements:
Helper.GetExportedFunctionto use the new parameter snapshot mechanism forExport-ModuleMember, eliminating dynamic parameter resolution and improving reliability in multi-threaded analysis. [1] [2]GetModuleManifestForAnalysisto share module manifest validation between rules during a single analysis, reducing redundant work.Miscellaneous:
CommandLookupKeyto useStringComparer.OrdinalIgnoreCasefor correctness.These changes collectively make command and parameter metadata handling safer, faster, and more robust, especially under concurrent analysis scenarios.## PR Summary
when the PR is ready.