Re: Most efficient way of storing 1024*1024 bits

2005-11-04 Thread Alex Stapleton
On 4 Nov 2005, at 10:26, Ben Sizer wrote: > Tom Anderson wrote: > >> On Wed, 2 Nov 2005, Dan Bishop wrote: >> >> >>> Tor Erik Sønvisen wrote: >>> >>> I need a time and space efficient way of storing up to 6 million bits. >>> >>> The most space-efficient way of storing bits is to

Re: Most efficient way of storing 1024*1024 bits

2005-11-04 Thread Ben Sizer
Tom Anderson wrote: > On Wed, 2 Nov 2005, Dan Bishop wrote: > > > Tor Erik Sønvisen wrote: > > > >> I need a time and space efficient way of storing up to 6 million bits. > > > > The most space-efficient way of storing bits is to use the bitwise > > operators on an array of bytes: > > Actually, no,

Re: Most efficient way of storing 1024*1024 bits

2005-11-03 Thread Tom Anderson
On Wed, 2 Nov 2005, Dan Bishop wrote: Tor Erik Sønvisen wrote: I need a time and space efficient way of storing up to 6 million bits. The most space-efficient way of storing bits is to use the bitwise operators on an array of bytes: Actually, no, it's to xor all the bits together and store

Re: Most efficient way of storing 1024*1024 bits

2005-11-03 Thread Alex Martelli
Alex Stapleton <[EMAIL PROTECTED]> wrote: ... > >>> Six megabytes is pretty much nothing on a modern computer. > > > >> BTW, it'd be 6 megabits or 750kb ;) > > > > ...but Mike was proposing using one digit per bit, hence, 6 megabytes. > > That makes it easy to search for bitpatterns with re or

Re: Most efficient way of storing 1024*1024 bits

2005-11-03 Thread Alex Stapleton
On 3 Nov 2005, at 05:03, Alex Martelli wrote: > Brandon K <[EMAIL PROTECTED]> wrote [inverting his topposting!]: > > >>> Six megabytes is pretty much nothing on a modern computer. >>> > > >> BTW, it'd be 6 megabits or 750kb ;) >> > > ...but Mike was proposing using one digit per bit, hence, 6 meg

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Alex Martelli
Brandon K <[EMAIL PROTECTED]> wrote [inverting his topposting!]: > > Six megabytes is pretty much nothing on a modern computer. > BTW, it'd be 6 megabits or 750kb ;) ...but Mike was proposing using one digit per bit, hence, 6 megabytes. That makes it easy to search for bitpatterns with re or str

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Brandon K
BTW, it'd be 6 megabits or 750kb ;) > Six megabytes is pretty much nothing on a modern computer. == Posted via Newsgroups.com - Usenet Access to over 100,000 Newsgroups == Get Anonymous, Uncensored, Access to West and East Coast Server Farms! == Highest Retention and Completion Rat

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Dan Bishop
Tor Erik Sønvisen wrote: > Hi > > I need a time and space efficient way of storing up to 6 million bits. The most space-efficient way of storing bits is to use the bitwise operators on an array of bytes: import array class BitList(object): def __init__(self, data=None): self._data = arr

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Steven D'Aprano
On Wed, 02 Nov 2005 13:55:10 +0100, Tor Erik Sønvisen wrote: > Hi > > I need a time and space efficient way of storing up to 6 million bits. [inserts pinky in corner of mouth] Six MILLION bits!!! That's almost 750K. Are you sure your computer will handle that much data? > Time > efficency

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Bengt Richter
On Wed, 2 Nov 2005 13:55:10 +0100, "Tor Erik Sønvisen" <[EMAIL PROTECTED]> wrote: >Hi > >I need a time and space efficient way of storing up to 6 million bits. Time >efficency is more important then space efficency as I'm going to do searches >through the bit-set. > Very dependent on what kind

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Alex Martelli
Paul Rubin wrote: ... > You can use re.search on array.array byte vectors. I don't know how > the speed compares with string.find. Pretty well, though of course one should measure on representative cases for one's specific application needs: Helen:~ alex$ python -mt

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Mike Meyer
"Tor Erik Sønvisen" <[EMAIL PROTECTED]> writes: > I need a time and space efficient way of storing up to 6 million bits. Time > efficency is more important then space efficency as I'm going to do searches > through the bit-set. Six megabytes is pretty much nothing on a modern computer. I'd store

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Six megabytes is pretty much nothing on a modern computer. I'd store > the things as a string of "0" and "1", and then use .find (or maybe > the in keyword) for doing the searches. > > This doesn't work very well if you're going to mutate the string, > thou

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Paul Rubin
"Tor Erik Sønvisen" <[EMAIL PROTECTED]> writes: > I need a time and space efficient way of storing up to 6 million bits. Time > efficency is more important then space efficency as I'm going to do searches > through the bit-set. Umm, what kind of searches do you want to do? For speed you want to

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread [EMAIL PROTECTED]
C ? Tor Erik Sønvisen wrote: > Hi > > I need a time and space efficient way of storing up to 6 million bits. Time > efficency is more important then space efficency as I'm going to do searches > through the bit-set. > > regards tores -- http://mail.python.org/mailman/listinfo/python-list

Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Tor Erik S�nvisen
Hi I need a time and space efficient way of storing up to 6 million bits. Time efficency is more important then space efficency as I'm going to do searches through the bit-set. regards tores -- http://mail.python.org/mailman/listinfo/python-list