Hi,
Having just switched to a AMD dual 64bit processor, I noticed
that Ruby is obviously NOT tuned for a 64 bit processor. This is
quite understandable and and not a complaint.
Are there plans, probably in Far Distant Future, to improve
memory usage in a 64 bit world?
Just as an example, on 64 bit machines the basic object structure
doubles to 40 bytes. Thus, the heap structures double in size!
This is just an issue we should probably think about in the future!
Of course, as the cost of memory decreases, probably a minor one.
Chuck Thornton
ceo@hawthorne-press.com
on 06.01.2008 16:32
on 06.01.2008 20:25
Charles Thornton wrote: > doubles to 40 bytes. Thus, the heap structures double in size! > > This is just an issue we should probably think about in the future! > Of course, as the cost of memory decreases, probably a minor one. > > Chuck Thornton > ceo@hawthorne-press.com > > > As far as I'm concerned, the Far Distant Future is now. :) But seriously, I'd think rock-solid concurrency primitives for the multi-core part of the equation are more important than object structure sizes at this point in time. Besides, a 63-bit Fixnum gets you out of having to do Bignums a lot more often on a 64-bit machine. Program design is often a tradeoff between memory space and processor time, and I'd say, "go for the speed!" :)
on 07.01.2008 11:45
The data structures used for String#encode are also currently not tuned for 64bit processors, i.e. they also grow double. The reason for this, and for the growth in basic objects (and in array size,...) is that on a 64bit machine, pointers are 64bits, more or less by definition. Many ruby-internal data structures use some fields as pointers some times (where in my guess, overall, 'some times' is very roughly around 50%). So it's not too easy to reduce memory on a 64bit processor, except for the easy solution to compile for 32bit on machines where that's possible, and for usages where 64bits isn't necessary. Regards, Martin. At 00:31 08/01/07, Charles Thornton wrote: >doubles to 40 bytes. Thus, the heap structures double in size! > >This is just an issue we should probably think about in the future! >Of course, as the cost of memory decreases, probably a minor one. > > Chuck Thornton > ceo@hawthorne-press.com > > #-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University #-#-# http://www.sw.it.aoyama.ac.jp mailto:duerst@it.aoyama.ac.jp