Re: Vote: PEAR::Strip_Comments
| From: | Thorsten Suckow-Homberg | Date: | Thu, 29 Apr 2004 12:43:35 +0000 |
| Subject: | Re: Vote: PEAR::Strip_Comments | ||
| References: | 1 2 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-12221@lists.php.net to get a copy of this message | ||
> if you are concerned about performance, and are not using a cache..
> (which solves this isssue) - its a bit like building a house with only a
> spoon...
Well, there are people who cannot run a cache on their server (security
restrictions, no money etc. pp.).
This is just a call for "what do you think of it" and "would it increase the
performance", nothing else ;).
I may port this idea to a class that obfuscates JavaScript-Code. However,
I'm interested in that what people say. So keep it coming ;)
And btw.: There definitely is a diference in the speed:
HUGE_FILE.php (5234 lines of comments without code to interpret)
=================================================
["mean"]=> string(8) "0.037905"
["iterations"]=> int(100)
SMALL_FILE.php (2631 lines of comments without code to interpret)
=================================================
["mean"]=> string(8) "0.019446"
["iterations"]=> int(100)
I used the following code to test:
<?php
require_once 'Benchmark/Iterate.php';
$benchmark = new Benchmark_Iterate;
function foo()
{
//require("HUGE_FILE.php");
require("SMALL_FILE.php");
}
$benchmark->run(100, 'foo');
$result = $benchmark->get();
echo "<hr>";
var_dump($result);
?>