Replies: 8 comments
-
As a gut-check for the web, we could run this against the GraphiQL netlify deploy on every PR: Which would become relelvant to the point you raise once codemirror-graphql was using all the latest versions of the language services. So some additional specific benchmarking scripts that we could run with our end to end suite would be nice... Are you interested in server side benchmarking as well, for the LSP, or mostly just browser environment benchmarking? (My bad, just saw that you mentioned the LSP specifically) As far as end to end suite is concerned, we've been wanting to adopt Cypress.io, but we have an offer from Browserstack for an open source account which would allow us to show browser compatibility for codemirror-graphql (eventually monaco-graphql) and graphiql. Thinking we could use nightwatch, nightmare, or testcafe as the runner with browserstack. Are there any best practices that you are aware of already? |
Beta Was this translation helpful? Give feedback.
-
@Neitsch as per server benchmarking, the node project itself has a pretty neat tool for running its own benchmarks on node.js core features |
Beta Was this translation helpful? Give feedback.
-
I've used autocannon for writing benchmarks for http APIs, but testing the expected behavior of an LSP server would be somewhat different I imagine. A single user with potentially many json-rpc requests. I couldn't find much on benchmarking with LSPs specifically, but here is an example of a benchmark from the kotlin LSP if that helps at all? |
Beta Was this translation helpful? Give feedback.
-
@Neitsch Thanks for pinging 👍 The most important trick that I learned in all these attempts is to always disable Turbo Boost on my Macbook before running any benchmarks: https://github.com/rugarciap/Turbo-Boost-Switcher We had this discussion in the context of But we quickly discovered limitations of I also looked at what other projects are using and it looks like for benchmarking things that running ~1s I found Also, it uses In addition to that, I'm currently experimenting with Node.js's And it looks like after by combining all these approaches I finally got a decent result: So the difference between running two instances of the same code is |
Beta Was this translation helpful? Give feedback.
-
Hey all, I appreciate the suggestions of both of you. To stay in line with what graphql-js is doing, let's reuse the benchmark script as much as possible. I hope to get around implementing a simple benchmark later this week :) |
Beta Was this translation helpful? Give feedback.
-
@Neitsch Please note |
Beta Was this translation helpful? Give feedback.
-
Not sure how useful it for GraphiQL but I just added memory profiling to |
Beta Was this translation helpful? Give feedback.
-
very nice! we should do some benchmarks all the way up to interface, and eventually have benchmarks for the LSP server over different transports |
Beta Was this translation helpful? Give feedback.
-
Hi all,
as we discussed in the previous WG, we want to focus on performance. To do so we will need to introduce some sort of benchmarking. Is there any recommended way how to go about this? Should the benchmark run as part of our CI? Are there any widely used packages for benchmarking?
In the next 1 month, I'd like to write some tests that demonstrate slow behavior of the GraphQL LSP, so I'm looking for best practices here :)
Beta Was this translation helpful? Give feedback.
All reactions