FSharp.Data.GraphQL icon indicating copy to clipboard operation
FSharp.Data.GraphQL copied to clipboard

Optimization of field resolver expression execution

Open Horusiath opened this issue 9 years ago • 0 comments

This is idea to make FSharp.Data.GraphQL faster and allocating less memory on field execution - consider we have following field definition:

Define.Field("firstName", String, fun _ person -> person.FirstName)

At this point (compilation phase), we already know that the first function field (FieldExecutionContext) is not used. Therefore we actually don't need to create it, and we could pass a simple null instead. We know it won't be used anyway. This could give us potential gain on fields resolution as we construct contexts only when needed.

Horusiath avatar Sep 29 '16 08:09 Horusiath