Reduce subshells #57

merged 2 commits into from Dec 5, 2011


None yet

2 participants


Rails boot seems to be spending a lot of time creating subshells. These two commits should reduce the subshells that ExecJS creates by implementing which in Ruby. File stats are reduced by lazily searching for the executable.

I made a similar change to bundler.




@josh josh merged commit aaa25c4 into sstephenson:master Dec 5, 2011
@josh josh commented on the diff Dec 5, 2011
+ private
+ def binary
+ @binary ||= locate_binary
+ end
+ def which_windows(name)
+ result = `#{shell_escape("#{ExecJS.root}/support/which.bat", name)}`
+ result.strip.split("\n").first
+ end
+ def which_unix(name)
+ if File.executable? cmd
josh Dec 5, 2011

name vs cmd


Fixed 9329d2b

@luislavena luislavena referenced this pull request Dec 6, 2011

Remove subshells windows #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment