Home > Archive > PHP Pear > April 2004 > Re: [PEAR] Vote: PEAR::Strip_Comments
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PEAR] Vote: PEAR::Strip_Comments
|
|
| Clay Loveless 2004-04-28, 5:38 pm |
| On 4/28/04 1:07 PM Pacific Time, Thorsten Suckow-Homberg (ts@siteartwork.de)
wrote:
> Since the PEAR-(Package-)Class-Files get bigger with every comment and
> phpDoc-Code you add to your file, I thought of an automatism that strips
> those comments for the use in a productive environment.
> This would result in a faster access and reducing overhead because of
> loading files which source-code exists to ~60% of comments and
> documentation.
Thorsten,
I'm curious if you've done any benchmarking to see if doing what you propose
would really result in a significant improvement in access and overhead
reduction. My suspicion is that the difference in access and/or overhead
performance of code with comments and code without is negligible,
particularly if you're using a PHP accelerator like Turck MMCache.
If you decide to run benchmarks, please post the tests you ran and their
results.
-Clay
--
Killersoft.com
| |
| Thorsten Suckow-Homberg 2004-04-28, 5:38 pm |
|
> My suspicion is that the difference in access and/or overhead
> performance of code with comments and code without is negligible,
> particularly if you're using a PHP accelerator like Turck MMCache.
Right, if you choose an accelerator the cached files do not contain any
comments anymore, that's what I have heard.
> If you decide to run benchmarks, please post the tests you ran and their
> results.
Using the PEAR::Benchmark and the following code
<?php
require 'Benchmark/Timer.php';
$timer = new Benchmark_Timer();
$timer->start();
//require_once("HUGE_FILE.php");
require_once("SMALL_FILE.php");
$timer->stop();
$timer->display();
?>
where HUGE_FILE.php (48288) is my Image_Imagick.php proposal
(http://www.siteartwork.de/image_imagick/Imagick.tgz) with comments and the
SMALL_FILE.php (18475)
(manually) stripped down (leaving white-spaces and new lines), I got the
following results:
HUGE_FILE.php
============
Lowest: 0.013940
Peak: 0.024210
SMALL_FILE.php
============
Lowest: 0.010831
Peak: 0.015010
(WindowsXP, apache 1.3, PHP4.3, 512 MB RAM, 1.7 Celeron)
| |
|
| Thorsten Suckow-Homberg wrote:
>
>
> Right, if you choose an accelerator the cached files do not contain any
> comments anymore, that's what I have heard.
>
>
>
>
> Using the PEAR::Benchmark and the following code
>
> <?php
> require 'Benchmark/Timer.php';
>
> $timer = new Benchmark_Timer();
> $timer->start();
>
> //require_once("HUGE_FILE.php");
> require_once("SMALL_FILE.php");
>
>
> $timer->stop();
> $timer->display();
> ?>
>
> where HUGE_FILE.php (48288) is my Image_Imagick.php proposal
> (http://www.siteartwork.de/image_imagick/Imagick.tgz) with comments and the
> SMALL_FILE.php (18475)
> (manually) stripped down (leaving white-spaces and new lines), I got the
> following results:
>
> HUGE_FILE.php
> ============
> Lowest: 0.013940
> Peak: 0.024210
>
>
> SMALL_FILE.php
> ============
> Lowest: 0.010831
> Peak: 0.015010
>
> (WindowsXP, apache 1.3, PHP4.3, 512 MB RAM, 1.7 Celeron)
Can you re-run these benchmarks with Benchmark_Iterate? You will need
to change your test code so its not a class obviously...
- Davey
|
|
|
|
|