Re: does //commenting reduce performance?

From: Date: Sun, 24 Nov 2002 14:58:20 +0000
Subject: Re: does //commenting reduce performance?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-125804@lists.php.net to get a copy of this message
Neatly done Ernest! Also in showing how these questions are best answered with five minutes on the PC, than a msg to the list... > 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/ > > >

« previous php.general (#125804) next »