graphql

hlship 2019-11-13T19:00:09.069100Z

Funny thing, I just tried running the Lacinia benchmarks where there's no ResolverResultImpl, instead resolve-as creates a ResovlerResultPromise and immediately delivers the value to it. Guess how much that affected the benchmarks?

hlship 2019-11-13T19:00:17.069200Z

hlship 2019-11-13T19:01:57.070200Z

it's really a tiny uptick. I wonder if there's a difference in real code? And does that mean it might make sense to remove

hlship 2019-11-13T19:02:13.070600Z

optimizations from lacinia concerning ResolverResultImpl?

hlship 2019-11-13T19:24:02.071700Z

Ultimately, probably safest to keep the code as is, but the optimizations are relatively inconsequential, which is a surprise. I would have thought it would have been more of a double-digit percentage jump in execution time.

hlship 2019-11-14T17:28:03.074600Z

I'll push what I have. I actually went further and removed the optimizations that assume a ResolverResult (not a RRPromise).

gklijs 2019-11-14T20:49:46.075Z

I try to do several runs with the released version tonight, if it goes well (I did some changes) I can run the branch the next night.

hlship 2019-11-14T21:08:22.075200Z

To what degree do you use ResolverResultPromise (e.g., async resolvers)?

gklijs 2019-11-14T21:41:51.075400Z

I don't use them at all. In my case the Schema is very flat, so it wouldn't really make sense. Every GraphQL query will always be only one database query.

hlship 2019-11-14T22:29:35.076400Z

Our scenario is much more complicated, with a mesh of data coming from Cassandra and half a dozen various external services. I'm working on a DataLoader library to help ensure that work is cached, shared across threads, and parallelized and batched where possible.

👍 1