public function PerformanceTest::testCachedReadPerformanceWithInMemory

@group performance

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php, line 23

Class

PerformanceTest

Namespace

Doctrine\Tests\Common\Annotations

Code

public function testCachedReadPerformanceWithInMemory() {
  $reader = new CachedReader(new AnnotationReader(), new ArrayCache());
  $method = $this
    ->getMethod();
  $time = microtime(true);
  for ($i = 0, $c = 500; $i < $c; $i++) {
    $reader
      ->getMethodAnnotations($method);
  }
  $time = microtime(true) - $time;
  $this
    ->printResults('cached reader (in-memory)', $time, $c);
}