views:

78

answers:

1

Hi,

I wrote a simple AJAX callback function in Drupal that performs a query to the DB and returns a JSON formatted string. Nothing fancy, the standard AJAX declaration in the module with a modest amount of information (less than 4KB). The query to the database takes 52ms. Drupal adds around 320ms of overhead for a total of 370ms + latency. And that in my development machine (only one user)...

Is this normal? Do you know how you can decrease that huge overhead?

Context: - Clean install - No extra modules - Without the Drupal cache. I want to know the real performance of Drupal (I'm starting to be really concerned about how slow this is - I didn't expect it). - APC opcode cache activated

Thanks in advance, Juan

P.D.: At some point I was wondering what'd be the real effect of no having a connection pool to the DB like Java frameworks, and running the whole PHP script every time. Maybe I'm starting to see the performance problems of using PHP?

+2  A: 

Use js module to handle your ajax requests. You can specify only really necessary modules and includes required for you callback. It helps save about 30-70% time for your requests and even more, if you use cache to store processed data.

Denis Shishkov