I've been looking in to speeding up Lemonstand for a client and did some profiling with XHProf. I found a very interesting bottleneck on the Category pages. 354 calls of uniqid() - which you call in the DB_ActiveRecord constructor - were responsible for a little over 13% of the total processing time.
This seemed way too high, so I did some investigation. Based on the following blog post http://portfolio.tec...ed.com/notes/44, all you need to do is change the uniqid() calls with uniqid("", true) and you'll see a very significant speed increase, especially when loading lots of ActiveRecord records. The major culprit here is on line 226 of db_activerecord.php, although it's also called in a few other places.
I can verify this is true, as after this change uniqid() was responsible for roughly 1.5% of processing time rather than 13% and I saw load times decrease by approximately .7 seconds.
I'm also experimenting with caching template output with APC - would you be interested in my code changes there also?
This post has been edited by pnomolos: 07 September 2010 - 05:22 PM

Help













