There is a reference table that shows the execution cost of every php function?
I know that the time execution is boundet to many factors and is impossible to determinate an unique value, but im looking for a ‘ideological’ table.
For example,
is_dir() = cost 3
is_file() = cost 2
(take it JUST as an example 😉
If i dont remember bad, for C there is a table with cpu cycles needed to every operation..
EDIT: i read all you comment, and so there are any table for my needs.
Anyway, i know that
is_dir('/');//is faster than
is_dir('/a/very/long/path/to/check/');
But, i have some trouble to accept this situation (that, if i have understood right your words, is possible);
$a = '/';
$b = '/a/very/long/path/to/check/';
is_dir($a); //time execution 0.003
is_file($a); //time execution 0.005
//so suppose is_dir is faster than is_file
//(still example, function names and number are random ;)
is_dir($b); //time execution 0.013
is_file($b); //time execution 0.009
//wow, now is faster is_file()....?
Such a chart would not be helpful or accurate. In your example, the timing of the function would depend very much on the details of the local filing system and would quickly become meaningless.
The only true way to measure performance is to build your code, then time it. Is for faster than while? Maybe one will be better than the other in one situation, while the other would be faster in another situation, depending on all kinds of factors that would be specific to the code within.
Time your code, using a profiler, and get some meaningful data that is accurate for your project on your server environment.