Thanks for sharing, I’m going to try and find some time this week to look at your benchmarks under perf. I’d like to be able to share your post more widely with companies I talk to after I better understand your recommendations. I spend a lot of time with people doing microservice-like stuff but for in-process slowdowns I currently can’t say much more than “yeah, your node graphql app is the slowest and most resource intensive thing you run and you should probably point a profiler at it because there’s no world in which an app that produces that output from those inputs needs that many resources”. I say that to… basically every company running a frontend as a backend or whatever it’s called this week.
I’d like to could come up with some sort of context-switch like metric I could collect for things scheduled on the event loop so that I can say “ok this request invoked the event loop or called process.nextTick 1000 times and 100 is a more reasonable target if you want to serve more requests per second”.
When executed, a GraphQL query with nested fields will result in a promise per field being created
Is it possible to not do this and instead generate a single SQL query based on the GraphQL query?
For some reason I assumed this was how GraphQL servers were implemented. My knowledge is very limited though. I’ve only used GitHub’s GraphQL API seriously. It would return deeply nested queries very fast which is why I assumed what I did.
Thanks for sharing, I’m going to try and find some time this week to look at your benchmarks under
perf. I’d like to be able to share your post more widely with companies I talk to after I better understand your recommendations. I spend a lot of time with people doing microservice-like stuff but for in-process slowdowns I currently can’t say much more than “yeah, your node graphql app is the slowest and most resource intensive thing you run and you should probably point a profiler at it because there’s no world in which an app that produces that output from those inputs needs that many resources”. I say that to… basically every company running a frontend as a backend or whatever it’s called this week.I’d like to could come up with some sort of context-switch like metric I could collect for things scheduled on the event loop so that I can say “ok this request invoked the event loop or called process.nextTick 1000 times and 100 is a more reasonable target if you want to serve more requests per second”.
Is it possible to not do this and instead generate a single SQL query based on the GraphQL query? For some reason I assumed this was how GraphQL servers were implemented. My knowledge is very limited though. I’ve only used GitHub’s GraphQL API seriously. It would return deeply nested queries very fast which is why I assumed what I did.