schemaBuilder = new SchemaGenerator([ 'totalTypes' => 600, 'fieldsPerType' => 8, 'listFieldsPerType' => 2, 'nestingLevel' => 10 ]); $this->schema = $this->schemaBuilder->buildSchema(); $queryBuilder = new QueryGenerator($this->schema, 0.05); $this->descriptor = $this->schema->describe(); $this->smallQuery = $queryBuilder->buildQuery(); } public function benchSchema() { $this->schemaBuilder ->buildSchema() ->getTypeMap() ; } public function benchSchemaLazy() { $this->createLazySchema(); } public function benchSmallQuery() { $result = GraphQL::execute($this->schema, $this->smallQuery); } public function benchSmallQueryLazy() { $schema = $this->createLazySchema(); $result = GraphQL::execute($schema, $this->smallQuery); } private function createLazySchema() { return new Schema( \GraphQL\Type\SchemaConfig::create() ->setQuery($this->schemaBuilder->buildQueryType()) // ->setDescriptor($this->descriptor) ->setTypeLoader(function($name) { return $this->schemaBuilder->loadType($name); }) ); } }