Ejemplo n.º 1
0
function _execute($file)
{
    global $executable;
    $command = new LimeCommand($executable, dirname(__FILE__) . '/LimeAnnotationSupport/' . $file);
    $command->execute();
    return $command;
}
Ejemplo n.º 2
0
// which test suite should I run for reference?
define('TEST_SCRIPT', dirname(__FILE__) . '/prove.php');
// roger!
// the resulting number of test runs is PROCESSES_LIMIT*TEST_RUNS
include dirname(__FILE__) . '/../../lib/LimeAutoloader.php';
LimeAutoloader::register();
$processCounts = array();
$stats = array();
for ($i = 1; $i <= PROCESSES_LIMIT; ++$i) {
    $stats[$i] = array();
    for ($j = 1; $j <= TEST_RUNS; ++$j) {
        $processCounts[] = $i;
    }
}
shuffle($processCounts);
foreach ($processCounts as $i => $processCount) {
    $time = microtime(true);
    echo "Running " . ($i + 1) . " of " . count($processCounts) . " ({$processCount} processes)\n";
    $command = new LimeCommand(TEST_SCRIPT, array('processes' => $processCount));
    $command->execute();
    $stats[$processCount][] = microtime(true) - $time;
}
foreach ($stats as $key => $stat) {
    $stats[$key] = array_sum($stat) / count($stat);
}
echo "\n";
echo "BENCHMARK RESULTS\n";
echo "=================\n";
foreach ($stats as $nb => $stat) {
    echo str_pad("{$nb} processes", 20, ' ') . str_pad(round($stat, 2) . ' sec', 10, ' ') . round(-100 * ($stat - $stats[1]) / $stats[1], 2) . "%\n";
}