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

[Codegen] Codegen fails to finish with many nested fragments #3434

Open
pm-dev opened this issue Aug 29, 2024 · 1 comment
Open

[Codegen] Codegen fails to finish with many nested fragments #3434

pm-dev opened this issue Aug 29, 2024 · 1 comment
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation

Comments

@pm-dev
Copy link

pm-dev commented Aug 29, 2024

Summary

When running codegen on a large project with many operations with nested fragments, codegen hangs and never finishes. We were hoping the disable fragment merging feature would solve this, sadly it does not.

In an email exchange with @AnthonyMDev it sounded like this is a known issue:

This is also a known issue. It’s pretty rare, but some users with a LOT of nested fragments, we’re seeing this issue currently.

It’s due to the collections that hold all the computed merged fragment fields being so large that they are causing these issues. My current hypothesis is that the performance problem is mostly seen when the collection exceeds its capacity and is copied into a larger buffer.

I’ve been dealing with other issues, so I haven’t gotten around to this one yet, but my thought is that I can replace the array with a more suitable data structure. I think a custom tree implementation is going to be able to resolve it. Once I get the fragment merging resolved, I’ll try to work on that...

Wanted to open an issue so we can track it and prioritize it! Thanks, looking forward to finally adopting v1!

Version

1.0

Steps to reproduce the behavior

I've previously submitted a schema and .graphql operation files that allow reproducing this. Happy to send it again.

Logs

No response

Anything else?

No response

@pm-dev pm-dev added bug Generally incorrect behavior needs investigation labels Aug 29, 2024
@calvincestari
Copy link
Member

Thanks for creating the issue @pm-dev. I thought we already had an issue open for this work but I can't seem to find it so I'll add this one to the relevant milestone for tracking the work.

@calvincestari calvincestari added codegen Issues related to or arising from code generation and removed needs investigation labels Aug 29, 2024
@calvincestari calvincestari added this to the Minor Releases (1.x) milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation
Projects
None yet
Development

No branches or pull requests

2 participants