On Sep 23, 2007, at 19:55 , Ruby Maniac wrote:

> I welcome any corrections anyone might be able to make since I am new
> to Ruby with less than 3 months experience under my belt.
>
> Ruby 1.8.6 is an interpreted langauge that does not have a byte-code
> driven VM at this time.
>
> Python 2.5.1 is an interpreted language that does have a byte-code
> driven VM.
>
> I have been able to make Ruby code run 5% faster or more simply by
> removing nothing but comments - the more comments I remove the faster
> the code runs up to no more than 6% or 7%.

Then you aren't benchmarking with enough iterations.  Comments are  
skipped and thrown away.  They aren't part of the AST.

> [...] Lexically interpreted langauges would want this
> to be the case since it takes more effort to lex more characters.

And you only lex a file once in Ruby.  As a proportion of runtime,  
turning a source file into an AST is small.

> Python runtimes are not affected by the number of characters one uses
> such as extra whitespace or comments

Nor are Ruby's.

> - removing comments does not make Python code run faster simply  
> because the comments have been removed.

$ echo '5 + 6 # and a comment, which is not in the AST' |  
parse_tree_show -f
s(:call, s(:lit, 5), :+, s(:array, s(:lit, 6)))

No, really, they aren't there.

I stopped reading your email here.  I scanned the rest and you didn't  
provide any code to back up your assertion that removing comments  
improves ruby performance.  I'd be happy to look at it if you can  
post it.