Azu Posted September 2, 2007 Share Posted September 2, 2007 Hello I can benchmark the time between the startup and the shutdown, but how can I benchmark the time of the actual startup and shutdown themselves? Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/ Share on other sites More sharing options...
Wuhtzu Posted September 2, 2007 Share Posted September 2, 2007 Startup and shutdown (of what) ? Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-339819 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 PHP Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340364 Share on other sites More sharing options...
ToonMariner Posted September 3, 2007 Share Posted September 3, 2007 get your stopwatch out.... Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340366 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 LOL, not really. the same way you would time a page loading, call a php script from php. <?PHP (start timer here) require(samp.php); (end timer here) ?> <?PHP ?> Now if your server doenst ignore the file altogether, this should give you the time it takes to parse and load an entire php file. (engine times). just devide by two and u have shutodnw and startup I guess... otherwise you can't. lol, rememerb to use a 14 digit floating point number, or you might get 0 as the time. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340473 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Thanks, but by the time it sees the include it has already started up, and it won't shutdown until after the include and after the timers.. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340496 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 yes but it registers another engine (php.exe) or (php-cgi.exe) per request or page load. as far as my system works it seems to start a process PER include and require, os thats how I time mine.. I get outputs like this: 0.00000000000119 0.00000000000110 0.00000000000197 0.00000000000211 0.00000000000128 0.00000000000087 and so on. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340498 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Hmm.. so this will be accurate for measuring the differance in startup/shutdown times between differant extensions being used for? Because that is what I'm trying to use this for. Like to see if mysqli adds less to startup/shutdown time, or if mysql does, for example. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340502 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 it should, hwy dont you try it out and tell me the output? remember to use micro time with a 14 digit floating point number Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340506 Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 PHP and all its extensions are loaded when the server starts, not when your script comes across calls to a particular extension. Unless you are using dl to load extensions manually at runtime. Measuring execution times this way may help indicate which extensions process certain operations quicker, but its no indication of the extension startup/shutdown times. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340574 Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 Oh man. I'm having a shoker today. It would appear my description above only relates to the cgi and cli SAPI's. I'll just be quiet. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340583 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 lol but if your php is a module, its modules load independantly per process (itsnot smart but hey, php did it, not me) Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340585 Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 What exactly do you meen by module? There are no modules in php. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340587 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 PHP and all its extensions are loaded when the server starts, not when your script comes across calls to a particular extension. Unless you are using dl to load extensions manually at runtime. Measuring execution times this way may help indicate which extensions process certain operations quicker, but its no indication of the extension startup/shutdown times. Thanks! I think maybe something is different in my PHP installation though. If, say, I move one of the extension DLLs away, then on PHP startup, PHP gives an error and crashes. If I start up my server without the DLL there, it starts fine. I put it back before opening a PHP page, and it works fine. So I'm pretty sure that the extensions are loaded by PHP on every page load for me for some reason.. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340590 Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 Sorry, read my last reply. You can get more detail about the startup process here. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340592 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Oh okay thanks. Well if anyone knows of like a third party program or something that can benchmark how long it takes for PHP to startup I'd really appreciate that ^^ I think maybe PHP can benchmark itself on this since it can't do anything until it has started up.. and can't measure itself as it is shutting down.. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340594 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 I eman if php is copiled as a module to the web server. as verse to the alternatice, cgi. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340609 Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 I'm running PHP as CGI. Link to comment https://forums.phpfreaks.com/topic/67642-benchmark-startup-and-shutdown/#findComment-340621 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.