I had similar speed issues in an evolutionary computing class last semester. I took it as an opportunity to learn Haskell and Scala, and noticed that in addition to getting dramatic speedups, I also had a lot more fun writing the code in the first place.