Comments (2)
I was doing some profiling on this and a couple of the major ones are taking the dependency on the Configuration Module and the Add-Type for EmptyStringAsNullAttribute.
The add-type adds nearly a second to the load time for me, and Configuration module another 500ms. I hand-edited the code to remove these two dependencies and load time dropped down to 300ms cold start which is much more reasonable for something that is going to run "first time" on every load and greatly impacts the users perception of their powershell performance.
from powerline.
I'm not sure I can safely take off the EmptyStringAsNull
on the color parameters, but I could easily put that attribute type into the PANSIES assembly and remove the Add-Type call. That would be an easy win, so I will definitely do that.
The configuration module I'm not so sure about. Without it, you need to reconfigure your prompt in your profile on each load (and any time you wanted to change the configuration, you have to edit your profile). Part of the performance problem may be implicit module loading. For best performance, in your profile you should have a Import-Module
statement that lists all the modules you need in a single line, in dependency order. E.g.:
Import-Module Configuration, PANSIES, PowerLine
If I wanted to make Configuration optional I would need to rely on documentation, and as you can see from the other issues, we already have problems with people not understanding the insufficient docs.
That is, I could make Set-PowerLinePrompt
only call Import-Configuration
if the Configuration module is already imported, and then hack the module packaging so that Install-Module
still installs Configuration, but Import-Module
doesn't implicitly import it... but then people who wanted convenience would have to manually specify the Configuration module in their profile...
from powerline.
Related Issues (20)
- PowerLine fails to import saved prompt including a single-quoted string HOT 2
- Get-SegmentedPath variably handles alternative PSDrives with bugs
- Conditional block colors HOT 1
- Special characters is not shown in powershell. HOT 4
- List available blocks + how to add them.
- Run this every time ? HOT 2
- Install fails without -AllowClobber HOT 1
- Can't install with Pansies 1.4.0-beta03 HOT 1
- Error with separator HOT 1
- Support for no background colour HOT 4
- Loading profile info from Documents\WindowsPowerShell even when running on PSCore HOT 1
- Where is the prompt settings stored? HOT 4
- Doesn't work in Powershell Core HOT 3
- Needed to install prerelease Pansies HOT 4
- Error With New PowerShell 7.1 preview 2 - Get-Date Usage Needs Full Parameter Name HOT 2
- Exception in PowerLinePrompt HOT 7
- PowerLine 3.4.0 fails to read a config that worked with 3.3.0 HOT 8
- Req: A community theme repo HOT 2
- "Exception thrown from prompt block" even when the exception is handled within the block HOT 5
- What is the correct way to write a clear final separator?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerline.