From: Eric Wong Date: 2012-10-12T06:40:34+09:00 Subject: Re: [ANN] google_hash v 0.7.0 released. Faster hashes for MRI. Roger Pack wrote: > > From the readme: > > > >> These also use significantly less memory, because (if you specify IntToInt, it stores only 4 bytes per int, instead of Ruby's usual 20 bytes). This also frees up Ruby so it doesn't hvae to garbage collect as much. Yea! > > > > 20 bytes?? What exactly is this referring to? I thought this was referring to st_table_entry size in st.c, but that's 6 words (24 bytes in 32-bit, 48 bytes in 64-bit) on MRI 1.9 with ordered hashes (unpacked). > Normal size (or at least used to be) of a "ruby object" in 32 bit MRI. > I believe it's RObject: > http://fossies.org/dox/ruby-1.9.3-p194/structRObject.html > The size may be bigger in 64 bit MRI, I'm not sure. RObject is 40 bytes on 64-bit MRI. On the plus side with 64-bit, embedded strings can be up to 23 bytes (vs 11 bytes for 32-bit) so there's a better chance of avoiding malloc() overhead with strings.