The following improvements to the core PowerShell engine have been implemented in WMF 5.1:
Performance has improved in some important areas:
- Pipelining to cmdlets like ForEach-Object and Where-Object is approximately 50% faster
Some example improvements (your results may vary depending on your hardware):
|Scenario||5.0 Time (ms)||5.1 Time (ms)|
|First ever PowerShell run:
|Command analysis cache built:
Note One change related to startup might impact some unsupported scenarios. PowerShell no longer reads the files
$pshome\*.ps1xml-- these files have been converted to C# to avoid some file and CPU overhead of processing the XML files. The files still exist to support V2 side-by-side, so if you change the file contents, it will not have any effect to V5, only V2. Note that changing the contents of these files was never a supported scenario.
Another visible change is how PowerShell caches the exported commands and other information for
modules that are installed on a system.
Previously, this cache was stored in the directory
In WMF 5.1, the cache is a single file
See Module Analysis Cache for more details.