Repository navigation
Avoid PowerShell startup for Windows parent command queries - #918
Merged
Merged
Conversation
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.
Windows currently launches PowerShell whenever a hook inspects its parent command. Use Ruby's COM support to query the same WMI
CommandLinefield directly whenwin32oleis available, and retain the existing PowerShell implementation when the library is missing or COM access fails. This adds no dependency; Ruby versions withoutwin32olekeep the fallback.Five paired GitHub Windows measurements on the production-sized shards all improved: 10.3% median and 8.9% aggregate test-command reduction, with positive results in both control/candidate execution orders. The slowest sampled shard fell from 51.8s to 46.2s. Benchmark run.
Validation: existing examples retained; added coverage for complete Unicode command lines, exited/inaccessible processes, denied COM access, and missing
win32ole. Local utility specs and RuboCop pass. Full Ruby 3.3/3.4/4.0 × Ubuntu/Windows CI is required before merging.Final verification: full GitHub CI passed in 1m43s, with all 1,703 examples executed exactly once for each of the six Ruby/OS combinations (10,218 executions). Aggregate coverage increased to 92.425%, +0.02 percentage points. Optional partial-shard coverage comparisons changed when the five new examples redistributed later examples; required CI/lint and every matrix job passed.