Passed
Push — master ( e7bef7...3228c5 )
by Vladimir
03:06
created

LexerBench::benchIntrospectionQuery()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 0
1
<?php
2
namespace GraphQL\Benchmarks;
3
4
use GraphQL\Language\Lexer;
5
use GraphQL\Language\Source;
6
use GraphQL\Language\Token;
7
use GraphQL\Type\Introspection;
8
9
/**
10
 * @BeforeMethods({"setUp"})
11
 * @OutputTimeUnit("milliseconds", precision=3)
12
 */
13
class LexerBench
14
{
15
    private $introQuery;
16
17
    public function setUp()
18
    {
19
        $this->introQuery = new Source(Introspection::getIntrospectionQuery());
20
    }
21
22
    /**
23
     * @Warmup(2)
24
     * @Revs(100)
25
     * @Iterations(5)
26
     */
27
    public function benchIntrospectionQuery()
28
    {
29
        $lexer = new Lexer($this->introQuery);
30
31
        do {
32
            $token = $lexer->advance();
33
        } while ($token->kind !== Token::EOF);
34
    }
35
}
36