[Tutor] Python performance on Windows system

Joel Ricker joejava@dragoncat.net
Mon, 29 Oct 2001 19:51:24 -0500


----- Original Message -----
From: "Roeland Rengelink" <r.b.rigilink@chello.nl>

> Without further ado, here's a class (bitset) that packs the information
> you're interested in. It uses the fact that an integer contains 32 bits.
> So I can store n bits of information in an array of n/32 integers. I
> also include a version of your sieve algorithm that uses the bitset to
> store its result.

All I can say is wow!

1 to 10 million ran in a matter of minutes as opposed to several hours --
not sure how long as I haven't had the patience to let the script suck up
that much system resources as I mentioned before.  I ran 1 to 50 million
while I was at work.  Not sure how long it took but it was finished when I
got home and ran nicely with my Prime95 program (distributed project to find
next largest merseinne prime).

In the back of my mind I thought that the use of binary numbers to pack
information would be a better way to go and as I can see I was right.  My
problem is that its just an idea -- I don't quite know how to implement
effectively binary constructs to store data.  I know how binary numbers work
(ie 010 = 2, 1111 = 15) and thats it -- all the comp sci classes I've ever
taken never went into detail as to how to use them.  >> and << operators
mean really nothing to me.  I've seen them used in code before especially
mathematical computations and would like to learn more. Can anyone recommend
any resources of study either online or book form that covers this topic
thoroughly?

Thanks
Joel