At 12:58 24.11.2002, DL Neil said:
--------------------[snip]--------------------
>Why don't you run a microtime testbench to time a commented and an
>uncommented loop, settle your mind, and report back with REAL information!?
--------------------[snip]--------------------
Some time ago I've made myself a framework for such tests and have run it
against a commented loop. This test was run on a dual PIII/1000 Dell server.
$hpr = _fwx_profile_start('Loop with end-of-line comment', true);
for ($i = 0; $i < 1000000; ++$i) {
$a += 1; // this is an end-of-line comment
}
_fwx_profile_end($hpr, $i);
Average time per loop: 0.059 msec
$hpr = _fwx_profile_start('Loop with inline comment', true);
for ($i = 0; $i < 1000000; ++$i) {
/* this is an inline comment */ $a += 1;
}
_fwx_profile_end($hpr, $i);
Average time per loop: 0.059 msec
$hpr = _fwx_profile_start('Loop without comment', true);
for ($i = 0; $i < 1000000; ++$i) {
$a += 1;
}
_fwx_profile_end($hpr, $i);
Average time per loop: 0.059 msec
Conclusio: I didn't find any measurable difference in these loops, be it an
end-of-line comment, an inline comment, or no comment.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php