-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Faster dot source #1255
Closed
Closed
Faster dot source #1255
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Join-Path won't add "\"'s without the use of a delimeter. In this case there is no delimiter and as a result the script will fail when it tries to look up $CmderModulePath.
Fix missing "\" when building dirpath to psmodules
This reverts commit 6978bb7.
Development into Master
Added kill ssh-agent to build.ps1
closes cmderdev#1035 Thanks @raleighr3
clink.get_cwd() is returning a string which is differently encoded than what clink.prompt.value expects. This results in garbled path names if the path condains non-ASCII chars. The (arguable hacky) solution is to parse the old prompt for the current directory (which breaks if the user sets a PROMPT env var which is incompatible to the regex used here...). Also parse out a environment name set by systems like virtualenv or conda: this could be done more specifically by targeting each such system and using the usually set environment variable but this would mean that we would have to do that for each and every such system out there and that is probably not a sane idea...
Parse the original prompt for cwd and env names
E.g., if ${CMDER_ROOT} is /c/Users/Foo Bar/cmder, the following errors will occur: bash: pushd: /c/Users/Foo: No such file or directory bash: [: /c/Users/Foo: binary operator expected bash: /c/Users/Foo: No such file or directory
Inspecting the script uncovers similar problems elsewhere not encountered in my initial testing. They are fixed accordingly.
…der_root_has_spaces Fix bash login when $CMDER_ROOT has spaces
just minor typos
Update Readme.md
After execution command: git add * git continues to operate without closing. The process does not stop.
…ter specific and default ConEmu.xml files
fix error when path has a space
Fixes cmderdev#1122 by simply calling CreateProcess before the SendMessageTimeout calls that are used to propagate environment variable changes.
Fix for slow startup under certain conditions (cmderdev#1122)
Fixed 3 typos
User conemu cfg
Fix typo in init.bat
Documented some undocumented tab related shorcuts
Fix cmderdev#1245: Allow alias value to contain '=' characters
This[1] blog post describes a faster method of importing use script into the powershell session by loading the file contents into memory proir to letting powershell parse them for auto-complete values. Reference: 1: https://becomelotr.wordpress.com/2017/02/13/expensive-dot-sourcing/ Testing: Test cmderdev#1 --- dotsource(ms) | scriptblock(ms) | filename(test data) ------|------|---- 18 | 13 | Approve-Script.ps1 6 | 2 | Clear-PrinterQueue.ps1 14 | 3 | ConvertTo-ImageFormat.ps1 9 | 2 | Copy-MultipleItems.ps1 6 | 2 | Enter-RemoteSession.ps1 6 | 3 | Get-CurrentUser.ps1 7 | 3 | Get-LogonHistory.ps1 6 | 2 | Get-SSID.ps1 6 | 2 | Invoke-DscPullAndApply.ps1 8 | 3 | Move-Drive.ps1 7 | 2 | New-ComputerList.ps1 6 | 2 | New-Directory.ps1 6 | 3 | Set-Proxy.ps1 7 | 2 | Shortcut.ps1 6 | 3 | Start-Delprof.ps1 6 | 3 | Suspend-Computer.ps1 9 | 4 | SystemInformation.ps1 6 | 3 | Test-ModuleSpeed.ps1 7 | 5 | Test-TCPConnection.ps1 6 | 2 | Update-ModuleReadMe.ps1 11 | 3 | Watch-Here.ps1 Test cmderdev#2 --- dotsource(ms) | scriptblock(ms) | filename(test data) ------|------|----- 40 | 24 | Approve-Script.ps1 8 | 4 | Clear-PrinterQueue.ps1 24 | 12 | ConvertTo-ImageFormat.ps1 14 | 8 | Copy-MultipleItems.ps1 7 | 4 | Enter-RemoteSession.ps1 10 | 4 | Get-CurrentUser.ps1 30 | 6 | Get-LogonHistory.ps1 6 | 4 | Get-SSID.ps1 7 | 4 | Invoke-DscPullAndApply.ps1 11 | 8 | Move-Drive.ps1 11 | 5 | New-ComputerList.ps1 11 | 4 | New-Directory.ps1 6 | 5 | Set-Proxy.ps1 11 | 5 | Shortcut.ps1 10 | 12 | Start-Delprof.ps1 12 | 5 | Suspend-Computer.ps1 69 | 5 | SystemInformation.ps1 11 | 4 | Test-ModuleSpeed.ps1 6 | 7 | Test-TCPConnection.ps1 8 | 4 | Update-ModuleReadMe.ps1 10 | 9 | Watch-Here.ps1
I see what's happened here, my branch was created from the latest in master not development. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So this is a PR because I'd like to see some testing and hopefully some benchmarks regarding the speed increase. I've found it a bit random if it is faster or not.
This[1] blog post describes a faster method of importing use script into
the powershell session by loading the file contents into memory prior to
letting powershell parse them for auto-complete values.
Reference:
1: https://becomelotr.wordpress.com/2017/02/13/expensive-dot-sourcing/
Testing:
Test #1
Test #2