Question

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?

Was it helpful?

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.

OTHER TIPS

Hard to give specific advice without a specific question, but here are some general optimization/organization techniques:

  1. Profile to find hot spots in your code
  2. you mention mysql queries being slow to load, try to optimize them
  3. possibly move data base access to stored procedures to help modularize your code
  4. look for repeated code and try to move it to objects one piece at a time
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top