GraphQL parser comparison in different languages

Related tags

graphql-parser-bench
Overview

graphql-parser-bench

Parsing a schema or document can be a critical part of the application, especially if you have to care about latency. This is the case for proxies or caches where high load is expected. This benchmark should outline good candidates. We use the libraries as documented in tests or documentation. We don't tune a specific parser. We assume that a new query arrives the parser at any time.

Benchmark

This test requires Rust, Go and Node.js (>=14)

Intermediate result

Parsing a schema

Parse the gitlab schema. The schema has a size of around 671KB.

./bench.sh ./../schema.graphql schema
  • graphql-go-tools: 5.7179ms
  • graphql-parser: 7.4608ms
  • gqlparser: 7.7642ms
  • async-graphql-parser: 12.7027ms
  • graphqljs (warmed): 11.1135ms
  • graphqljs (cold): 39.505ms
  • go-graphql: Error

🏆 Winner: In terms of speed graphql-go-tools wins!

Compared to different aspect like accessibility and maintainability async-graphql-parser is the overall winner. It uses a PEG grammar as input.

Parsing a query

Parse the kitchen-sink document. The document has a size of around 1KB but with a wide usage of the specification.

./bench.sh ./../kitchen-sink.graphql query
  • graphql-parser: 20.9µs
  • gqlparser: 38.8µs
  • graphql-go-tools: 42.6µs
  • graphqljs (warmed): 0.2104ms
  • graphqljs (cold): 1.4962ms
  • async-graphql-parser: Error
  • go-graphql: Error

🏆 Winner: In terms of speed graphql-parser wins! Alarming that some popular parser can not even parse the query.

Contribute

Feel free to improve or add another parser to the list. PR's are welcome!

Issues
Owner
Dustin Deus
Fullstack Engineer specialized in Web and Distributed Systems. Cloud-Native Applications | DevOps | CI-CD | Test Automation. Currently GraphQL at scale!
Dustin Deus
A collection of Go packages for creating robust GraphQL APIs

api-fu api-fu (noun) (informal) Mastery of APIs. ?? Packages The top level apifu package is an opinionated library that aims to make it as easy as pos

Chris 38 Sep 29, 2021
GraphQL parser comparison in different languages

graphql-parser-bench Parsing a schema or document can be a critical part of the application, especially if you have to care about latency. This is the

Dustin Deus 18 Oct 16, 2021
Tools to write high performance GraphQL applications using Go/Golang.

graphql-go-tools Sponsors WunderGraph Are you looking for a GraphQL e2e data fetching solution? Supports frameworks like NextJS, type safety with gene

Jens Neuse 224 Oct 22, 2021
⚡️ A Go framework for rapidly building powerful graphql services

Thunder is a Go framework for rapidly building powerful graphql servers. Thunder has support for schemas automatically generated from Go types, live q

null 1.4k Oct 11, 2021
GraphQL server with a focus on ease of use

graphql-go The goal of this project is to provide full support of the GraphQL draft specification with a set of idiomatic, easy to use Go packages. Wh

null 4k Oct 18, 2021
GraphQL server with a focus on ease of use

graphql-go The goal of this project is to provide full support of the GraphQL draft specification with a set of idiomatic, easy to use Go packages. Wh

null 4k Oct 21, 2021
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Tom Wright 1.6k Oct 20, 2021
GraphQL implementation for click house in Go.

clickhouse-graphql-go GraphQL implementation for clickhouse in Go. This package stores real time streaming websocket data in clickhouse and uses Graph

Rakesh R 4 Oct 19, 2021
go generate based graphql server library

gqlgen What is gqlgen? gqlgen is a Go library for building GraphQL servers without any fuss. gqlgen is based on a Schema first approach — You get to D

99designs 6.7k Oct 24, 2021
Convert Golang Struct To GraphQL Object On The Fly

Straf Convert Golang Struct To GraphQL Object On The Fly Easily Create GraphQL Schemas Example Converting struct to GraphQL Object type UserExtra stru

Roshan Mehta 31 Aug 11, 2021
GQLEngine is the best productive solution for implementing a GraphQL server 🚀

GQLEngine is the best productive solution for implementing a graphql server for highest formance examples starwars: https://github.com/gqlengine/starw

null 83 Sep 17, 2021
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.

GraphJin - Build APIs in 5 minutes GraphJin gives you a high performance GraphQL API without you having to write any code. GraphQL is automagically co

Vikram Rangnekar 1.6k Oct 22, 2021
JSON query expression library in Golang.

jsonql JSON query expression library in Golang. This library enables query against JSON. Currently supported operators are: (precedences from low to h

Qian Chen 246 Oct 11, 2021
graphql parser + utilities

graphql utilities for dealing with GraphQL queries in Go. This package focuses on actually creating GraphQL servers and expects you to describe your s

Travis Cline 53 May 27, 2021
Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.

GoArcc - Go monolith with embedded microservices including GRPC,REST, graphQL and The Clean Architecture. Description When you start writing a Go proj

Deqode 70 Oct 20, 2021
Query Parser for REST

Query Parser for REST Query Parser is a library for easy building dynamic SQL queries to Database. It provides a simple API for web-applications which

Tim S. 26 Oct 17, 2021
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.

gqlanalysis gqlanalysis defines the interface between a modular static analysis for GraphQL in Go. gqlanalysis is inspired by go/analysis. gqlanalysis

null 30 Sep 13, 2021
Resource Query Language for REST

RQL is a resource query language for REST. It provides a simple and light-weight API for adding dynamic querying capabilities to web-applications that

Ariel Mashraki 231 Oct 1, 2021
The backend for a Symmetric node.

node-backend The backend for a Symmetric node. Contributing We have a contributing guide over here. Community You can contact us by joining our discor

null 7 Oct 18, 2021