Jump to content

Benchmark startup and shutdown


Azu

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.