erikwrede / rustberry

Python Bindings for apollo-rs
MIT License
14 stars 0 forks source link

Convert apollo-rs AST to gql-core ast #3

Closed erikwrede closed 1 year ago

erikwrede commented 1 year ago

Overhead approx. 4ms on our 1ms test query

erikwrede commented 1 year ago

Intermediate test results for a small query:

{ hello, greeting, fruits { name } }

Results using pure graphql-core

(test-parser-py3.10)  ~/dev/opensource/strawberry-graphql-parser/test_parser   test-ast ●✚  python core_full_schema_bench.py
type Query {
  hello: String
  greeting: String
  fruits: [Fruit]
}

type Fruit {
  name: String
}
Execution on graphql-core took an average of 1.064457279862836 milliseconds (100 iterations)

Results using graphql-core with rustberry parsing & validation (Mirrored Core Types)

(test-parser-py3.10)  ~/dev/opensource/strawberry-graphql-parser/test_parser   test-ast ●✚  python rustberry_full_schema_bench.py 
type Query {
  hello: String
  greeting: String
  fruits: [Fruit]
}

type Fruit {
  name: String
}
Execution on graphql-core with rustberry parsing took an average of 0.22207291971426457 milliseconds (100 iterations)

Results using graphql-core with rustberry parsing & validation (Imported Core Types)

(test-parser-py3.10)  ~/dev/opensource/strawberry-graphql-parser/test_parser   test-ast ●✚  python rustberry_full_schema_bench.py
type Query {
  hello: String
  greeting: String
  fruits: [Fruit]
}

type Fruit {
  name: String
}
Execution on graphql-core with rustberry-gql-types parsing took an average of 0.5230925400974229 milliseconds (100 iterations)