I think I found the problem, I tried running the code on my windows machine at home and this time it took 26 seconds. The other times I've tried it I've used the univesity's linux machines, and I think reading off a remote hard-drive has added some latency to the process. I'm pretty sure the whole file is in memory because when testing all 52C7 it takes a fraction of a second to complete.