ProcessWire - Performance
Aus Wikizone
Version vom 12. Februar 2020, 10:08 Uhr von 37.49.72.8 (Diskussion) (Die Seite wurde neu angelegt: „== Performance Testen == === Zeit und RAM === <syntaxhighlight lang="php"> </syntaxhighlight> // 8000 pages with title and body fields $pp = $pages('template=b…“)
Performance Testen
Zeit und RAM
// 8000 pages with title and body fields $pp = $pages('template=basic, parent=1384'); $out = ; foreach($pp as $p) {
$t = $p->title . microtime(); $b = $p->body . mt_rand(0, 1e5); $out .= $t . $b;
} echo strlen($out); // 18384.08ms, 25.00 MB
// 8000 pages with title and body fields
$pp = $pages('template=basic, parent=1384');
$out = ;
foreach($pp as $p) {
$out .= $p->title . microtime(); $out .= $p->body . mt_rand(0, 1e5);
} echo strlen($out); // 17617.05ms, 25.00MB
$out = ;
foreach($pages('template=basic, parent=1384') as $p) {
$out .= $p->title . microtime(); $out .= $p->body . mt_rand(0, 1e5);
} echo strlen($out); // 17927.9ms, 25.00MB