'kfSafeFilemtime', 'sha1_file' => 'kfSafeFileSha1', 'md5_file' => 'kfSafeFileMd5', ) as $method => $fn) { for ($i = 0; $i < 32; $i++) { $start = microtime(true); foreach ($iterator as $key => $value) { $fn( $value); } $timing = microtime(true) - $start; if ($i < 2) { $data[$method]['warmups'][] = $timing; } else { $data[$method]['main'][] = $timing; } } } $phpVersion = (wfIsHHVM() ? 'HHVM ' . HHVM_VERSION : 'PHP ' . PHP_VERSION ) . ' (' . PHP_SAPI . ')'; header( 'Content-Type: text/html; charset=utf-8' ); echo '

Benchmark

' . '

Part of T102578.

' . '' . '' . '' . '' . '
PHP' . htmlspecialchars($phpVersion) . '
OS' . htmlspecialchars(PHP_OS) . '
Inputresources/**/* (' . intval($fileCount) . ' files)
'; foreach ( $data as $method => $data ) { echo "

$method

"; foreach ($data as $group => $timings) { echo "'; } echo '
$group" . ((array_sum($timings) / count($timings)) * 1000 ) . 'ms total on average (' . count($timings) . ' samples)' . '
'; }