Closed ryanquinn3 closed 1 year ago
Hey @dimatill, any chance you've had a moment to look over this change?
wow, @ryanquinn3 this is a great finding! Thank you!
@dimatill This is what I get for submitting the PR via github's web editor 😞
Commit pushed. I've confirmed that the package builds & tests pass.
Thank you @ryanquinn3 !!!
:tada: This PR is included in version 6.1.35 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Hi there, at work we have a very large graphql schema and use graphql middlewares heavily. I've recently been debugging why our graphql server takes so long to start up and identified one area in this library that contributes a good chunk of that time.
I found that this library performs quite poorly when a particular middleware contains a lot (~1k+) of keys. After a deeper inspection, I see that applicator.ts uses the reduce/spread anti-pattern which I have been bitten by a few times in the last handful of years. The simple changes in this PR should not change the behavior of this library at all but they did reduce the total latency of our
applyMiddleware
call from ~11s to about 6s. If others in the community are using this library with large schemas & middlewares then I want them to benefit as well.