From: lalawawa Date: 2010-01-27T10:20:04+09:00 Subject: Distressing Doc I was reading www.ruby-lang.org, and under "To Ruby From C and C++" it said * As of Ruby 1.8, code is interpreted at run-time rather than compiled to any sort of machine- or byte-code. which sounds like a huge disadvantage compared to other languages. I did some testing and I get the impression that Ruby is compiling your code to some form of compiled version in ram before it runs it. I made the following test programs ten_million.rb: #!/usr/bin/ruby -w i = 10_000_000 while i > 0 i -= 1 end which ran in 4.9 seconds in ruby 1.8.7 on a 64 bit amd cpu ten_million.sh : i=10000000 while [ $i -gt 0 ] ; do i=$(($i - 1)) done which ran in 287 seconds. Note on my machine /bin/sh is a symlink to /bin/dash ten_million.pl #!/usr/bin/perl -w $i = 10000000; while ($i > 0) { $i -= 1; } which ran in 2.45 seconds in perl v6.10.0 ten_million.py #!/usr/bin/python i = 10000000 while i > 0: i -= 1 which ran in 2.84 seconds on python 2.6 If Ruby wasn't being compiled, I think the run time would be comparable to Bourne shell. I suspect that what they meant by that statement in the doc is that there is no way to SAVE the compiled version, but the compiled version does exist in ram.