From: Josh Cheek Date: 2011-09-19T16:59:16+09:00 Subject: Re: Ruby Speed Question --bcaec5186a5e17ce1504ad46b89b Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 19, 2011 at 2:48 AM, Robert Klemme wrote: > On Sun, Sep 18, 2011 at 8:42 PM, Josh Cheek wrote: > > > Some reasons differences between the Ruby and Java versions are that Ruby > > doesn't have primitives, so all those numbers are objects (ie using > Java's > > Integer rather than int). > > This is not 100% true. While they are from a language user's > perspective under the hood there are some optimizations especially for > Fixnums. This still leaves overhead for method invocation but memory > usage is very low and there is no GC overhead. > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > > I've had people say this to me in the past, but I don't understand how this can be, given that I can set instance variables on Fixnums: 1.class # => Fixnum 1.instance_variable_set :@abc, 12 1.instance_variable_get :@abc # => 12 --bcaec5186a5e17ce1504ad46b89b--