If you think you are having performance issues, profile your code to check where your bottlenecks are. Devel::NYTProf is an example of a good utility in this area. We cannot help you improve performance unless you provide specific pieces of code that you have experimentally demonstrated are your bottlenecks.