Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warmup servers prior to executing benchmarks #219

Closed
kyri-petrou opened this issue Nov 5, 2023 · 2 comments
Closed

Warmup servers prior to executing benchmarks #219

kyri-petrou opened this issue Nov 5, 2023 · 2 comments

Comments

@kyri-petrou
Copy link

kyri-petrou commented Nov 5, 2023

Hi there 👋 I'm looking to add another Scala GraphQL library to the benchmarks. When I first looked at the current results I was a bit surprised that Sangria (Scala) was performing this badly. After looking at the benchmarking script, it seems that the servers are not warmed up prior to being benchmarked.

The JVM has a notoriously bad cold-start performance (see related post here), so any GraphQL libraries from JVM languages (Java, Kotlin, Scala, etc.) being benchmarked will show as having very poor performance if the server is not warmed up prior to measuring request latencies.

A very simple way to warmup the servers is to execute this line twice, discarding the results from the first invocation. Ideally, the first invocation should be with a smaller number of connections to prevent overwhelming the server as it warms up. I believe that this might also help resolve #217.

I'm happy to create a PR if you agree with this approach

@tusharmath
Copy link

The other thing about these benchmarks are that it doesn't really test GraphQL capabilities. Instead it tries to benchmark the webserver.

We prefer benchmarking on https://github.com/tailcallhq/graphql-benchmarks which are a lot more thorough.

@jgillich
Copy link
Member

jgillich commented Nov 7, 2023

I agree about warming up, PR welcome.

it doesn't really test GraphQL capabilities. Instead it tries to benchmark the webserver.

static-rust is a literal webserver benchmark, and the difference between that one and async-graphql/juniper is over 2x. So it's far from "only" benchmarking webservers. But it could certainly be improved (#190), note that this was a side project that I hacked together in a weekend 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants