Php optimization…

I’ve read today an article titled “Php Optimization: Save the server!” created by Dcrab. This article has some interesting points but it is second or third article i read where author is focusing on small site performance problems such as including external scripts into application. I agree with fact that every developer shall make his code optimized but in reasonable manner. The real bottlenecks in bigger applications aren’t the include files. We have to focus on content caching, database resultsets caching, db query caching and even object caching. I won’t sacrifice my Smarty templates and MVC code just to save some CPU cycles because the final code will be totally unmaintainable. Everyone knows that template systems are slow. But with properly cached content it would be really faster when the same code would be done with php with html mixed in ? I doubt. The another things that matters here is OOP. Shall we code without OOP as we all know that structural way is in theory faster ? In my personally opinion, going back to structural code is very bad idea.

I remember when i was coding on my Commodore 64 in 6502 assembler. Some things there had to be cycle exact and there sometimes was no enough CPU cycles to perform certain operations (such as opening sideborders and displaying sprites there). We were forced then to write hundreds lines of machine code to make it working. It was my secondary school time and we were happy with sitting for months coding our demos and searching for 1 CPU cycle there. Now the times are little different ;)

Anyway I’m happy that someone still has time to point out some basic code problems. I hope that Dcrab will prepare another part of his article now with OOP, DB abstraction layers, template engine comparison (i know that Smarty might be slower, but it simply kicks).

Tags: , , , , ,

Leave a Reply

Powered by WP Hashcash