Skip to content

pwsh is 2 times slower than powershell to load #6443

@musm

Description

@musm

Powershell 6 is slow to start up compared to powershell

function time($block) {
    $sw = [Diagnostics.Stopwatch]::StartNew()
    &$block
    $sw.Stop()
    $sw.Elapsed
}

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17115  1

vs

Major  Minor  Patch  PreReleas BuildLabel
                     eLabel
-----  -----  -----  --------- ----------
6      0      2


mus@mus-laptop ~
> time {powershell -NoProfile -c exit}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 233
Ticks             : 2337327
TotalDays         : 2.70523958333333E-06
TotalHours        : 6.492575E-05
TotalMinutes      : 0.003895545
TotalSeconds      : 0.2337327
TotalMilliseconds : 233.7327



mus@mus-laptop ~
> time {pwsh -NoProfile -c exit}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 540
Ticks             : 5400421
TotalDays         : 6.25048726851852E-06
TotalHours        : 0.000150011694444444
TotalMinutes      : 0.00900070166666667
TotalSeconds      : 0.5400421
TotalMilliseconds : 540.0421





> time {cmd /c exit}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : **42**
Ticks             : 426119
TotalDays         : 4.93193287037037E-07
TotalHours        : 1.18366388888889E-05
TotalMinutes      : 0.000710198333333333
TotalSeconds      : 0.0426119
TotalMilliseconds : 42.6119



Winver: 17115.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    WG-Engine-Performancecore PowerShell engine, interpreter, and runtime performance

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions