You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of exposing the supergraph to the plugins is great, that allows flexibility and expands the possible usage for a lot of plugins, however, exposing the String supergraph_sdl could lead to developer having to parse and validate the sdl multiple times (one per plugin), on top of that, during schema reloads, all plugins are re-initialized, so, technically if I have a plugin that parses and validates the schema the router would need to parse and validate the schema TWICE, one for the actual router core functionality from Apollo-compiler and N times for every single plugin that needs to do that, now consider super graphs that are really big, we would effectively causing bottlenecks in the CPU, and that CPU time should be used exclusively for query planning and serde of requests and responses
Describe alternatives you've considered
Just expose the Supergraph instance.
Additional context
I have a supergraph that takes 600ms to parse,
600ms for core functionality
600ms for N plugins
bottleneck
The text was updated successfully, but these errors were encountered:
samuelAndalon
changed the title
exposing supergraph_sdl could lead to memory leak and CPU bottleneck
exposing supergraph_sdl could lead to memory leaks and CPU bottleneck
Nov 11, 2024
Describe the solution you'd like
The idea of exposing the supergraph to the plugins is great, that allows flexibility and expands the possible usage for a lot of plugins, however, exposing the String supergraph_sdl could lead to developer having to parse and validate the sdl multiple times (one per plugin), on top of that, during schema reloads, all plugins are re-initialized, so, technically if I have a plugin that parses and validates the schema the router would need to parse and validate the schema TWICE, one for the actual router core functionality from Apollo-compiler and N times for every single plugin that needs to do that, now consider super graphs that are really big, we would effectively causing bottlenecks in the CPU, and that CPU time should be used exclusively for query planning and serde of requests and responses
Describe alternatives you've considered
Just expose the Supergraph instance.
Additional context
I have a supergraph that takes 600ms to parse,
600ms for core functionality
600ms for N plugins
bottleneck
The text was updated successfully, but these errors were encountered: