Ryan Davis wrote in post #1131938:
> On Dec 31, 2013, at 8:40, Jabari Z. <lists / ruby-forum.com> wrote:
>
>> I have an algorithm which uses an array of boolean (True/False) data.
>> I would like to conserve and extend memory use by having the array
>> use less memory.
>
> Why? Do you have a measurable problem?

Yes.

Ideally I want to store the boolean (True/False) data in arrays that
take the least amount of memory to enable me to run out of the cpu cache
as much as possible and to allow the algorithm to search over larger
numbers.
Currently I'm memory limited on the size of numbers I can process.

On a 32/64 bit cpu a boolean would take 4/8 bytes of memory.
Even if I could do just byte addressing I could compute up to 4/8 times
larger numbers, and with bit arrays 32/64 times larger number within the
same address space, which I could fit in cache memory.

This is done all the time with languages like C/++, et al, which allow
you to control hardware at the bit level of registers and memory.

If you chunk your sizes correctly, the performance/memory advantages can
exceed the administrative overhead versus standard arrays,

It would be nice if Ruby would include this capability natively.

I did try the gems that were suggested (Peter Cooper and Ingram's) and
they do work for me. Now I want to see if I can make them faster or find
something that is.

So a grateful thanks to Abinoam Jr. for pointing me to that gem.

-- 
Posted via http://www.ruby-forum.com/.