note 72331 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:07:18 +0000 |
| Subject: | note 72331 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140671@lists.php.net to get a copy of this message | ||
Note Submitter: doom_quake at hotmail dot com
----
heavyraptor,
Optimization should consider two things:
1. The order in which the functions are called (due to load time, and processor prefetch)
2. The number of tests involved (10 is not enough)
I would try the test with 10,000 iterations and once with function 1 called first and once with
function 2 called first.
If possible, try not to store results in an array (since this step will get slower as time passes),
but rather process them inline. This can be done by storing the min and max time difference between
the two functions then comparing and overwriting if the current value is smaller/larger.
Also consider an average difference by adding the current time difference each time then dividing by
the number of iterations. This will give you a more accurate picture of the true speed benefit.