views:

121

answers:

3

I use the Kohana3's Profiler class and its profiler/stats template to time my website. In a very clean page (no AJAX, no jQuery etc, only load a template and show some text message, no database access), it shows the request time is 0.070682 s("Requests" item in the "profiler/stats" template). Then I use two microtime() to time the duration from the first line of the index.php to the last line of index.php, it shows almost very fast result. (0.12622809410095 s). Very nice result.

But if i time the request time from the browser's point of view, it's totally different. I use Firefox + Temper data add-on, it shows the duration of the request is 3.345sec! And I noticed that from the time I click the link to enter the website (firefox starts the animated loading icon), to when the browser finish its work(the icon animation stops), it really takes 3-4 seconds!!

In my another website which is built with WikkaWiki, the time measured by Temper Data is only 2190ms - 2432ms, including several access to mysql database.

I tried a clean installation of kohana, and the default plain hello-world page also loads 3025ms.

All the website i mentioned here are tested in the same "localhost" PC, same setting. Actually they are just hosted in different directories in the same machine. Only Database module is enabled in the bootstrap.php for kohana website.

I'm wondering why the kohana website's overall response is such slow while the php code execution time is just 0.126 second?? Are there anything I should look into?

==Edit for additional information ==

Test result on standard phpinfo() page is 1100-1200ms (Temper data)

A: 

Since your post confirms Kohana is finishing in a 1/10th of a second and less, it's probably something else:

  1. Have you tested something else other than Kohana? It sounds like the server is at fault, but you can't be sure unless you compare the response times with something else. Try a HTML and pure PHP page.
  2. The firefox profiler could be taking external media into consideration. So if you have a slow connection and you load Google Analytics, then that could be another problem.
The Pixel Developer
I tested the WikkaWiki page and the standard phpinfo() page, the result is 2190-2432ms, and 1100-1200ms respectively. No external resources loaded in my kohana website except some images in total size of 40k and some CSS, all are stored in the local host.
LazNiko
Strange, I suggest installing xdebug and profiling it to see where it's stalling.
The Pixel Developer
A: 

Profiler shows you execution time from Kohana initialization to Profiler render call. So, its not a full Kohana time. Some kind of actions (Kohana::shutdown_handler(), Session::_destroy() etc) may take a long time.

biakaveron
A: 

Maybe there is something related with this issue: http://stackoverflow.com/questions/1726585/firefox-and-chrome-slow-on-localhost-known-fix-doesnt-work-on-windows-7/1726609#1726609

Although the issue happens in Windows 7, maybe it can help...

clinisbut