From: Tim Pease Date: 2007-01-17T04:51:42+09:00 Subject: Re: efficient access to a large int32 array On 1/16/07, Christian Neukirchen wrote: > "Martin DeMello" writes: > > > I have a file that is a dump of a large array of 32-bit unsigned ints > > (bitvectors actually). All I need is to load this into memory and have > > fast, efficient access to the array members, and a few bitmasking > > operations - the array will never be written to, and ideally should > > not need to be bounds-checked. Should I be looking at something like > > mmap or narray to do this, or would I be better served by a custom C > > extension? > > I think Ara has been hacking some package to use Narray on mmap'ed > files, which works fast and is persistent. Search the archives. > http://codeforpeople.com/lib/ruby/nmap/ You'll need to install Guy's mmap package ... http://moulon.inra.fr/ruby/mmap.html Blessings, TwP