I worked on my site written in php / mysql. When I first wrote it, it was spaghetti with lots of php built into html, etc. - very difficult to maintain.
I rewrote it all with a good modular structure with OOPS, and now it is much easier to maintain and extend.
But when testing site performance using webwait and siege, the newer, better structured version seems to work and load slower than the spaghetti version.
During the boot process, the difference is almost 1 second - 2.39s versus 3.81s
Nothing else has been changed except php code, not js, not css
So what's the problem? Should I go back to the old code? Has this happened to others?
Edit:
- I did some analysis using cachegrind, inclued, and I think the code is pretty good.
- I also know that the problem is not completely OOPS, but a big structure, etc. and also that OOP does not guarantee better performance at all.
- I also ran the code several times.
- I used cachegrind with kcachegrind, inclued, siege (most of the tools of Rasmus lerdorf are outlined in his talk drupalcon 2008 on 'Simple Hard)
What I want to know is how others handle this.
source
share