-
-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using module builder pattern to halve module import time #692
Comments
I don't see a problem with adding a build for the module particularly if it can halve the module import time. As for as "optional" features, that might be tough as this module doesn't offer that much in the way of optional features. That said, I suppose there might be some folks who want only the tab-completion support. Doubt there are many that want only the prompt status and not tab-completion though. |
We've discussed elsewhere that a pre-publish build process would be useful in other ways, so I'm not opposed to this as a related optimization. I would want to make sure the module can still be loaded as-is from the Git repo, as many folks use their own fork of the project.
We could conceivably skip loading all the prompt/status infrastructure if |
Good feedback. |
I'd say |
Ok, I've actually opened PRs against both branches. Should we incorporate this into the build as well, by changing the |
I'd rather not change that line to always point to the release dir because my typical dev flow is to run Pester tests while I'm doing dev work (not having built). Maybe we can change that line to look for a variable like |
Whilst I like
posh-git
, it also adds a big portion (500-1000ms) to the load time of PowerShell because of the call toImport-Module posh-git
in the $PROFILE.One possibility of halving (I've done an experiment) the module import time, is to have all the source code in one monolithic file instead of dot sourcing them in. This does not mean the source code of the module needs to be stored in a monolithic file but one would need to add a build process before publishing the module, one does not need to re-invent the wheel though as one could e.g. use the ModuleBuilder module for that.
Would you be happy with that?
Or would it be useful to look into alternative ways of having a more lightweight module import (some user's might not use all features, so maybe we could defer some actions?)?
The text was updated successfully, but these errors were encountered: