Move exec
and shell_init
from chef-cli to chef.exe
#1505
Labels
Aspect: Performance
Works without negatively affecting the system running it.
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 inchef-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 inembedded/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 likeruby.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
The text was updated successfully, but these errors were encountered: