Skip to content
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

Move exec and shell_init from chef-cli to chef.exe #1505

Open
mwrock opened this issue Oct 14, 2020 · 0 comments
Open

Move exec and shell_init from chef-cli to chef.exe #1505

mwrock opened this issue Oct 14, 2020 · 0 comments
Labels
Aspect: Performance Works without negatively affecting the system running it.

Comments

@mwrock
Copy link
Member

mwrock commented Oct 14, 2020

On Windows, simply invoking chef-cli consumes ~3 seconds for it to do all of its gem loading and requiring before it ever gets to executing the actual command. That's just the joy of ruby on windows but these two commands should be straightforward to port to go (especially chef exec) and give windows users the gift of 3 seconds.

From what I can tell, the trickier part of implementing this in go is emiting the GEM_ variables. Emitting those from ruby in chef-cli, we can simply grab them from the current ruby environment. However I really wonder if we need these variables set. As long as the user's PATH is correctly configured, the bin stubs of the ruby tools in embedded/bin should force the ruby in that same directory. However I feel like we must be adding those for a good reason. At the least we could just shell out with something like ruby.exe -e "puts Gem.default_dir" which would still be much faster since it does not require any gem loading.

Aha! Link: https://chef.aha.io/features/SH-372

@mwrock mwrock added the Status: Untriaged An issue that has yet to be triaged. label Oct 14, 2020
@jonsmorrow jonsmorrow added Epic and removed Status: Untriaged An issue that has yet to be triaged. labels Nov 2, 2020
@tas50 tas50 added Aspect: Performance Works without negatively affecting the system running it. and removed Epic labels Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect: Performance Works without negatively affecting the system running it.
Projects
None yet
Development

No branches or pull requests

3 participants