Skip to content

Performance Improvements #1382

@michaelstaib

Description

@michaelstaib

While browsing the code I stumbled on the following:

else if (context.Selection.Field.Type.IsLeafType())

This middleware registered as a middleware for all fields.

With version 12 we have introduced pure resolvers which will improve execution performance by multiple times as not each field will be handled as its own resolver task for which we need to rent a context and other things. Instead pure fields ... or simple data fields can be folded into their parent.

This class essentially would be split up into two classes, one that handles the fetching of data and the other one that handles the unpacking of data.

Further we would not use the generic middleware but instead use a type interceptor to give each fields a specific middleware. This also would remove further cases from the class and benefit execution perf and memory allocations during execution.

When we introduced these changes to the introspection in Version 12 we saw the same instance go from 19983 requests per second to 33702 request per second on the same hardware.

Do you guys want to have a go at it with me?

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions