Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exposing supergraph_sdl could lead to memory leaks and CPU bottleneck #6251

Open
samuelAndalon opened this issue Nov 11, 2024 · 0 comments
Open

Comments

@samuelAndalon
Copy link
Contributor

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

@samuelAndalon 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant