Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Powershell initialization on linux is slow #1954

Copy link
Copy link
@jalons

Description

@jalons
Issue body actions

Steps to reproduce

Launch powershell

Expected behavior

Usable prompt in milliseconds

Actual behavior

Usable prompt in seconds

Environment data

PS /> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.9
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

For example:

[me@ipsum] ~
➜  cat test.ps1
#!/usr/bin/powershell
exit
[me@ipsum] ~
➜  time ./test.ps1
./test.ps1  1.30s user 0.12s system 138% cpu 1.035 total

Compared to:

[me@ipsum] ~
➜  cat test.sh
#/bin/bash
exit
[me@ipsum] ~
➜  time ./test.sh
./test.sh  0.00s user 0.00s system 0% cpu 0.002 total

The windows host I have available:

PS C:\Users\me> echo "exit" > test.ps1
PS C:\Users\me> Measure-Command {.\test.ps1}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 7
Ticks             : 71141
TotalDays         : 8.23391203703704E-08
TotalHours        : 1.97613888888889E-06
TotalMinutes      : 0.000118568333333333
TotalSeconds      : 0.0071141
TotalMilliseconds : 7.1141



PS C:\Users\me> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18033
BuildVersion                   6.2.9200.16434
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.The issue is fixed.WG-Engine-Performancecore PowerShell engine, interpreter, and runtime performancecore PowerShell engine, interpreter, and runtime performance

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.