ExtractPriorityQueue.php in Zircon Profile 8
File
vendor/zendframework/zend-stdlib/benchmark/ExtractPriorityQueue.php
View source
<?php
namespace ZendBench\Stdlib;
use Athletic\AthleticEvent;
use Zend\Stdlib\FastPriorityQueue;
use Zend\Stdlib\PriorityQueue;
use Zend\Stdlib\SplPriorityQueue;
class ExtractPriorityQueue extends AthleticEvent {
public function classSetUp() {
$this->splPriorityQueue = new SplPriorityQueue();
$this->fastPriorityQueue = new FastPriorityQueue();
$this->priorityQueue = new PriorityQueue();
for ($i = 0; $i < 5000; $i += 1) {
$priority = rand(1, 100);
$this->splPriorityQueue
->insert('foo', $priority);
$this->fastPriorityQueue
->insert('foo', $priority);
$this->priorityQueue
->insert('foo', $priority);
}
}
public function extractSplPriorityQueue() {
$this->splPriorityQueue
->extract();
}
public function extractPriorityQueue() {
$this->priorityQueue
->extract();
}
public function extractFastPriorityQueue() {
$this->fastPriorityQueue
->extract();
}
}