function benchmarkTest(&$u, $filename, $desc) { print "Testing {$filename} ({$desc})...\n"; $data = file_get_contents($filename); $forms = array('cleanUp', 'toNFC', 'NFC', array('fastDecompose', 'fastCombiningSort', 'fastCompose')); foreach ($forms as $form) { if (is_array($form)) { $str = $data; foreach ($form as $step) { $str = benchmarkForm($u, $str, $step); } } else { benchmarkForm($u, $data, $form); } } }
function benchmarkTest(&$u, $filename, $desc) { print "Testing {$filename} ({$desc})...\n"; $data = file_get_contents($filename); $all = $data; while (strlen($all) < BIGSIZE) { $all .= $all; } $data = $all; echo "Data is " . strlen($data) . " bytes.\n"; $forms = array('quickIsNFCVerify', 'cleanUp'); foreach ($forms as $form) { if (is_array($form)) { $str = $data; foreach ($form as $step) { $str = benchmarkForm($u, $str, $step); } } else { benchmarkForm($u, $data, $form); } } }