url-rewritingupgradelegacy-app

refactor old webapp to gain speed


4 years ago, I've built a webapp which is still used by some friends. the problem with that app, is that now it has a huge database, and it loads very slow. I know that is just my fault, mysql queries are mixted all over the places(even in the layout generation time).

ATM I know some about OO. I'll like to use this knowledge in my old app, but I don't know how to do it without rewriting all the from the beginning. Using MVC for my app, is very difficult at this moment.

If you were in my place, or if you will had the task to improve the speed of my old app, how you will do it? Do you have any tips for me? Any working scenarios?


Solution

  • It all depends on context. The best would be to change the entire application, introducing best practices and standards at once. But perhaps would be better to adopt an evolutionary approach:

    1- Identify the major bottlenecks in the application using a profiling tool or load test.

    2 - Estimate the effort required to refactoring each item.

    3 - Identify the pages for which performance is more sensitive to the end user.

    4 - Based on the information identified create a task list and set the priority of each item.

    Attack one prolem at a time, making small increments. Always trying to spend 80% of your time solving the 20% more critical problems.