What are your performance best-practices? |
[eluser]kilishan[/eluser]
I recently stumbled across DooPHP a new PHP framework, which claims to be "one of the fastest, if not the fastest PHP framework available." I've always been aware of the performance of my apps, though my knowledge in that area isn't what I wish it might be. Their benchmarks make some pretty bold claims so I downloaded it and tested it myself. The results were very surprising. Using their base app I am averaging 1100 request/second with XCache enabled. Comparing that to a bare-bones install of CodeIgniter running Ocular to show the welcome screen I'm only averaging around 240 rps. That's a drastic difference. Comparing it to a large site that I'm just finishing up, and the results are even more impressive. Granted, though, there's a lot of information getting pulled for the front page of my latest site. It did get me really thinking about performance, though. What can we do to make our CI sites run faster, just based on our coding style and software design? The first thing that comes to mind is the sheer number of files that we're loading. Every model, library, config file, etc takes time to find and memory to load. Is it possible to combine related models into a single file to reduce a little of that? For example, on a simple forum I've written, there's 4 model files, all related. One each for categories, topics, replies, and favorites. Now, they're all based off of a Base_model class, so that helps with memory because all of the common functions are only loaded into memory once, but it is a file. If I can reduce those 4 files into a single file, I'm thinking there might be a small performance boost there, but I don't know if I'd need to combine them all into one class or not. I don't have the answers here. I guess I'm mostly thinking out loud. I am going to try this with Ocular and theCloset, though, just to see if they have any measurable affect or not. If it does, I'll release an OcularPlus library that has the asset management included. I do want to hear your ideas, though. What do you do to help keep your performance optimized? Know any best practices or tips? If so, please share them in the comments. |
Messages In This Thread |
What are your performance best-practices? - by El Forum - 01-14-2010, 08:49 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 09:11 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 09:19 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 09:30 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 09:47 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 10:00 AM
What are your performance best-practices? - by El Forum - 01-14-2010, 10:30 PM
What are your performance best-practices? - by El Forum - 01-14-2010, 11:15 PM
What are your performance best-practices? - by El Forum - 01-14-2010, 11:33 PM
What are your performance best-practices? - by El Forum - 01-15-2010, 01:42 PM
|