Closed palindrom-zz closed 13 years ago
You can use xdebug to profile your app. That will allow you to find the bottleneck. In firebug you can also see a breakdown of how long connection took, etc. But measuring this should really be done on the server.
The folling snippets needs one second for execution. There is only this request, no other ressources like images or css files.
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->get('/hello/{name}', function ($name) {
return "Hello $name";
});
$app->run();
Any suggestions why takes one second? I've got a simple ZF application where the whole dispatching needs one second too. So I think thats not normal. @igorw how long takes the upper request on your machine? less than 50ms?
It takes ~35ms here.
I made a profiling. I'm not very experienced reading the cachegrind data. http://www.fileserve.com/file/24qbByw But if I am reading correct there is a comulated time of 46ms. But why do I have 1sec in firebug when requesting the script? Is there something between browser and localhost? Which slows that down which i forgot?
I analyzed with firebug and it seemed that my dns lookup took so long. It was a Windows 7 problem! http://cubicspot.blogspot.com/2010/07/fixing-slow-apache-on-localhost-under.html I removed the semicolon of the localhost entry in the windows hosts file and now silex is fast. Strangely other simple non-framework php scripts were fast than ever.
In that case this issue can be closed.
Hi I tried to do some simple actions with silex (e.g. crud) but I think it is a bit slow. I use the simple /hello/{name} example and it needs about 1 sec until I see the response in the browser (measured in firebug). I mean only for displaying the name, one second is a long time. It shouldn't take longer than 250ms for such a simple action. Is this normal? Or is my apache not configured well?