Mercurial > hg > isophonics-drupal-site
annotate vendor/zendframework/zend-stdlib/benchmark/RemovePriorityQueue.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 /** |
Chris@0 | 3 * Zend Framework (http://framework.zend.com/) |
Chris@0 | 4 * |
Chris@0 | 5 * @link http://github.com/zendframework/zf2 for the canonical source repository |
Chris@0 | 6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
Chris@0 | 7 * @license http://framework.zend.com/license/new-bsd New BSD License |
Chris@0 | 8 */ |
Chris@0 | 9 |
Chris@0 | 10 namespace ZendBench\Stdlib; |
Chris@0 | 11 |
Chris@0 | 12 use Athletic\AthleticEvent; |
Chris@0 | 13 use Zend\Stdlib\FastPriorityQueue; |
Chris@0 | 14 use Zend\Stdlib\PriorityQueue; |
Chris@0 | 15 |
Chris@0 | 16 class RemovePriorityQueue extends AthleticEvent |
Chris@0 | 17 { |
Chris@0 | 18 public function classSetUp() |
Chris@0 | 19 { |
Chris@0 | 20 $this->fastPriorityQueue = new FastPriorityQueue(); |
Chris@0 | 21 $this->priorityQueue = new PriorityQueue(); |
Chris@0 | 22 |
Chris@0 | 23 for ($i = 0; $i < 1000; $i += 1) { |
Chris@0 | 24 $priority = rand(1, 100); |
Chris@0 | 25 $this->fastPriorityQueue->insert('foo', $priority); |
Chris@0 | 26 $this->priorityQueue->insert('foo', $priority); |
Chris@0 | 27 } |
Chris@0 | 28 } |
Chris@0 | 29 |
Chris@0 | 30 /** |
Chris@0 | 31 * @iterations 1000 |
Chris@0 | 32 */ |
Chris@0 | 33 public function removePriorityQueue() |
Chris@0 | 34 { |
Chris@0 | 35 $this->priorityQueue->remove('foo'); |
Chris@0 | 36 } |
Chris@0 | 37 |
Chris@0 | 38 /** |
Chris@0 | 39 * @iterations 1000 |
Chris@0 | 40 */ |
Chris@0 | 41 public function removeFastPriorityQueue() |
Chris@0 | 42 { |
Chris@0 | 43 $this->fastPriorityQueue->remove('foo'); |
Chris@0 | 44 } |
Chris@0 | 45 } |