ScottLog

October 3, 2007

Primes

Filed under: Uncategorized — numist @ 9:30 am

So, I know I haven’t posted in a while, and it’s not for lack of things to say.

The internship at Apple has ended. The internship at VMware has begun. Both are incredible companies in their own right, and I have been privileged by both in that my code for both companies will wind up running on that computer in front of you, if you have a Mac or a VMware hosted product.

Last weekend I wrote a new IRC bot framework sort of thing based on PircBot. It’s a very good platform to build on, and I’m happy with my creation. Once I have tied up the loose ends, I’ll probably open it up for use by arbitrary folks on freenode and potentially other nets as well.

Tonight I’ve been working on prime number generation library for two goals. The first goal is efficient data structures. The second is fast primality tests and quick generation of very large primes for other research (crypto?).

To accomplish the latter goal, I wrote the library to load or save it’s generated prime table from disk on demand, but then found an interesting metric when testing: Loading from disk was the same speed as generating on the fly. What’s worse, generating primes in real time incrementally created a more useful prime table while loading from disk did not provide a complete prime table until the load was complete, which meant that generating primes in real time was more useful.

So I wanted to share that little bottleneck story. I’ve got this ultra-nice 7200rpm hard drive in my first-gen MacBook Pro and a two-threaded prime number generation algorithm can outrun it. Damn.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: