I had a similar problem. I had around 10 million entries for a search engine I wrote. Are you accessing some of the keys more than once when loading the data? If so, you can save a ton of time by presorting the data. I went from 8 hours to 35 minutes.
Another note, if you're using keys() on the hash, it will actually build a list of all the keys which will certainly thrash your box. Which is of course the correct behaviour.