Most efficient way of storing 1024*1024 bits

Paul Rubin http
Wed Nov 2 10:24:28 EST 2005


Mike Meyer <mwm at mired.org> 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,
> though.

You can use re.search on array.array byte vectors.  I don't know how
the speed compares with string.find.



More information about the Python-list mailing list