Fiu fiu

Dziekuje za ciekawa opinie , chcialem zauwazyc ze Chameleon to bardzo mlody projekt i wciaz bede nad nim pracowal

Cos chyba wydaje mi sie aby zrobic sobie kilka plikow testowych w roznych wariantach i szukac slabych ponktow Chameleona . Do wersji 1.2.0 powinno sie duzo zmienic

-- added :
Bardzo dziwna sprawa, sprawdzilem też na malym szablonie 1300B (
http://www.vertis.com.pl/trash/template.tpl ) i wyniki sa jakby inne :
Smarty 2.6.12 : 5000 iteracji (10 zmiennych) : 2.1057s :: 100.00%
Smarty 2.6.12 : 5000 powtórzeń : 1.6233s :: 100.00%
Chameleon CVS : 5000 iteracji (10 zmiennych) : 1.6662s :: 126.38%
Chameleon CVS : 5000 powtórzeń: 0.7706s :: 210.65%
Platforma testowa : Pentium 4 HT 2800 MHz / 512MB
Jak testowalem :
<?php
include_once('chameleon/class.chameleon.php');
include_once('smarty/Smarty.class.php');
function get_microtime()
{
return ((float)$usec + (float)$sec);
}
function smarty_tpl_1_1()
{
$tpl = new Smarty;
$tpl->template_dir = './smarty/templates';
$tpl->compile_dir = './smarty/templates_c';
$tpl->compile_check = false;
for ($i = 0; $i < 10; $i++)
{
$tpl->assign("var$i", 'blah');
}
$tpl->fetch('template.tpl');
}
function smarty_tpl_2_1($j)
{
$tpl = new Smarty;
$tpl->template_dir = './smarty/templates';
$tpl->compile_dir = './smarty/templates_c';
$tpl->compile_check = false;
for ($i = 0; $i < 10; $i++)
{
$tpl->assign("var$i", 'blah');
}
for ($i=0; $i<$j; $i++)
{
$tpl->fetch('template.tpl');
}
}
// - CHAMELEON -
function chameleon_tpl_1_1()
{
$tpl = new Chameleon;
$tpl->template_dir = './chameleon/templates';
$tpl->tags_dir = './chameleon/templates_tags';
$tpl->load('template.tpl');
for ($i = 0; $i < 10; $i++)
{
$tpl->setVar("var$i", 'blah');
}
$tpl->parse();
}
function chameleon_tpl_2_1($j)
{
$tpl = new Chameleon;
$tpl->template_dir = './chameleon/templates';
$tpl->tags_dir = './chameleon/templates_tags';
$tpl->load('template.tpl');
for ($i = 0; $i < 10; $i++)
{
$tpl->setVar("var$i", 'blah');
}
for ($i = 0; $i < $j; $i++)
{
$tpl->parse();
}
}
// -----------------------------------------
$iter = 5000;
$start = get_microtime();
for ($i=0; $i<$iter; $i++)
{
smarty_tpl_1_1();
}
$end = get_microtime();
$results['Smarty 2.6.12']['iter10'] = number_format($end-$start,4
);
$start = get_microtime();
smarty_tpl_2_1($iter);
$end = get_microtime();
$results['Smarty 2.6.12']['repl10'] = number_format($end-$start,4
);
// ----------------------------------------------
$start = get_microtime();
for ($i=0; $i<$iter; $i++)
{
chameleon_tpl_1_1();
}
$end = get_microtime();
$results['Chameleon CVS']['iter10'] = number_format($end-$start,4
);
$start = get_microtime();
chameleon_tpl_2_1($iter);
$end = get_microtime();
$results['Chameleon CVS']['repl10'] = number_format($end-$start,4
);
// ----------------------------------------------
$names['iter20'] = 'iteracji (20 zmiennych)';
$names['iter10'] = 'iteracji (10 zmiennych)';
$names['iter05'] = 'iteracji (5 zmiennych)';
$names['repl20'] = 'powtorzen (20 zmiennych)';
while(list
($version,$res) = each ($results)) {
while(list
($test, $result) = each ($res)) {
if (empty($first[$test])) {
$first[$test] = $result;
}
$name = $names[$test];
print($version.' : '.$iter.' '.$name.' : '.$result.'s :: '.$percent."%<br />"); }
}
?>
Mozesz podeslac mi swoj szablon na jakim robiles testy ?