Created
          October 16, 2012 00:51 
        
      - 
      
- 
        Save pjb3/3896661 to your computer and use it in GitHub Desktop. 
    Why is ruby 1.9.3 so slow to start?
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | $ time perl -e 'print "foo\n"' | |
| foo | |
| real 0m0.009s | |
| user 0m0.004s | |
| sys 0m0.004s | |
| $ time ruby -e 'puts "foo"' | |
| foo | |
| real 0m0.184s | |
| user 0m0.082s | |
| sys 0m0.101s | |
| $ ruby -v | |
| ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] | 
Hmm..appears to be related to rvm:
$ rvm system
$ time ruby -e ''
real    0m0.026s
user    0m0.003s
sys 0m0.015s
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
I get the following with the same version of Ruby.
bash-3.2$ time perl -e 'print "foo\n"'
foo
real 0m0.006s
user 0m0.003s
sys 0m0.002s
bash-3.2$ time ruby -e 'puts "foo"'
foo
real 0m0.016s
user 0m0.012s
sys 0m0.003s
bash-3.2$ time python -c 'print "foo"'
foo
real 0m0.026s
user 0m0.018s
sys 0m0.007s