Hi all

I'm developing a social networking app.  Performance-wise, the app is
working decently well on the live server, but as I've coded and coded
over the past few months, it has become increasingly slow on my local
development PC.  I'm running WAMP on Windows Vista.

My only hunch right now is that there are too many DB queries.  But to
bring the app to its knees?  It still doesn't seem like enough to me.

I've disabled CSS, I've disabled JS, still no change in performance.
It has to be server-side, since I'm getting "max execution" timeouts
regularly now -- even with debug set to 0.

My coding practices:

- I have tried to meticulously follow Cake's coding conventions.
- I've read through GoogleGroups on slow load and, yes, made sure my /
tmp/ folder has the necessary sub-folders intact.
-  I almost always use 'restrict' in my find() calls to severely limit
the number of tables a query will need, especially when I'm recursing
to 3 levels.

Here's the specs:

10 controllers
25 models
40 view files (incl elements)
10 custom helpers
12 custom components
2 vendors, of 2K LOC
5 includes, in /files/ in webroot, of 5K LOC
Avg. total image data on each page: 170K size
Avg number of models in $uses array in each controller: 6.

One odd thing I noticed was that, once I upgraded to Cake v1.2.0.7125
(RC1), in debug mode, my pages are now littered with 20-30 of these,
echoing out from god-knows-where in the core:

Query: __resetAssociations


And, always, several of these as well:

Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near '__resetAssociations' at line 1 [C:\Users
\Staples2\Documents\Tensegrity\cake_core\cake\libs\model\datasources
\dbo_source.php, line 501]

So this __resetAssociations is a bad query being sent to the database.

In debug mode of 2 on a user profile page, I run 116 queries that
total 634ms.  The biggest hits on the MySQL side come from the
DESCRIBE queries on my tables, each of which take between 17 and
47ms.  All of my actual SELECT queries only take between 1 and 3ms on
average.  Then those __resetAssociations queries which eat up 1 to 9ms
each.

I planted timestamps around my own files and the core files to find
bottlenecks, and here's what I found out:

In cake/core/bootstrap.php it takes 8-10 seconds to complete this
line: App::import('Dispatcher') .

There is also a 15-20 second period in running time between the
inclusion of the app_controller.php class file and the actual
execution of the beforeFilter() method for my first page render in
app_controller.

I know these initial benchmarks are probably pretty superficial.  I
just don't know enough about the core to try to guess where I should
be looking for bottlenecks.

Anything I'm missing??

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to