in reply to Question about benchmarking

As mentioned above, Devel::DProf is the best solution for finding things in your code that are slowing it down. However, if that looks too daunting to you, just use Time::HiRes with some print statements to tell you how long a particular section of code took. That will also allow you to time the full execution of your script, to determine if it's the script or the browser that's slowing you down.