public function PerformanceTest::testDocLexerPerformance

@group performance

File

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

Class

PerformanceTest

Namespace

Doctrine\Tests\Common\Annotations

Code

public function testDocLexerPerformance() {
  $method = $this
    ->getMethod();
  $methodComment = $method
    ->getDocComment();
  $classComment = $method
    ->getDeclaringClass()
    ->getDocComment();
  $time = microtime(true);
  for ($i = 0, $c = 500; $i < $c; $i++) {
    $lexer = new DocLexer();
    $lexer
      ->setInput($methodComment);
    $lexer
      ->setInput($classComment);
  }
  $time = microtime(true) - $time;
  $this
    ->printResults('doc-lexer', $time, $c);
}