-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
598 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.phpunit.result.cache | ||
/clover.xml | ||
/composer.lock | ||
/coveralls-upload.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<?php | ||
|
||
namespace LaminasBench\EventManager; | ||
|
||
trait TraitEventBench | ||
trait BenchTrait | ||
{ | ||
private $numListeners = 50; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace LaminasBench\EventManager; | ||
|
||
use Laminas\EventManager\EventManager; | ||
use Laminas\EventManager\SharedEventManager; | ||
use PhpBench\Benchmark\Metadata\Annotations\Iterations; | ||
use PhpBench\Benchmark\Metadata\Annotations\Revs; | ||
use PhpBench\Benchmark\Metadata\Annotations\Warmup; | ||
|
||
use function array_filter; | ||
|
||
/** | ||
* @Revs(1000) | ||
* @Iterations(10) | ||
* @Warmup(2) | ||
*/ | ||
class MultipleEventIndividualSharedListenerBench | ||
{ | ||
use BenchTrait; | ||
|
||
/** @var EventManager */ | ||
private $events; | ||
|
||
/** @var array */ | ||
private $eventsToTrigger; | ||
|
||
public function __construct() | ||
{ | ||
$identifiers = $this->getIdentifierList(); | ||
$sharedEvents = new SharedEventManager(); | ||
foreach ($this->getEventList() as $event) { | ||
$sharedEvents->attach($identifiers[0], $event, $this->generateCallback()); | ||
} | ||
$this->events = new EventManager($sharedEvents, [$identifiers[0]]); | ||
|
||
$this->eventsToTrigger = array_filter($this->getEventList(), function ($value) { | ||
return ($value !== '*'); | ||
}); | ||
} | ||
|
||
public function benchTrigger() | ||
{ | ||
foreach ($this->eventsToTrigger as $event) { | ||
$this->events->trigger($event); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.