Of course, you could just take the specification that you've described (which is quite good) and actually write it yourself. You'll be using a lot of hashes.
That said, what do you want "faster" for? This should just run once, right? Who cares if it runs in 2 minutes or overnight so long as it gets done ... ?
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?