manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

GQL Schema Organization and Class Structure #298

Closed djchapm closed 3 years ago

djchapm commented 3 years ago

Hey, I've mentioned before we run with multiple schemas, but the two primary schemas we use are both more than 11K lines long, producing a generated schema class that is around 250K lines long - causing intellij to puke even at 10G mem settings and 2G shared maven heap conifigured.

Some of the objects in these large schemas are duplicated, and since they're in diff packages, they are mutually exclusive types in generated code. Do you have any good examples of graphql schemas/organization that share in such a way that the generated classes are smaller? I've googled around - but my goal is for manifold class generation to be more manageable. Examples don't account for the impact of enormous schemas - and I'm not experienced enough with gql/manifold to identify a solution. Thanks!

rsmckinney commented 3 years ago

Hi @djchapm. I'm currently working toward reducing the footprint of generated graphql schema size, so you can expect some relief there, not sure how much.

Have you considered breaking up your schemas into multiple graphql files? That would reduce the amount of code per projected java file and perhaps reduce the impact of loading and changing them in IJ.

Would it be possible for me to obtain the large graphql schema files you are currently using? It would help verify performance changes.

djchapm commented 3 years ago

Checking - You know of any easy way to obfuscate a graphql schema? We would likely need some privacy agreement - checking on it.

rsmckinney commented 3 years ago

Hmm. Not aware of a grahpql schema obfuscator. Privacy agreement works for me.

djchapm commented 3 years ago

I've not had luck seeking NDA through Legal dept - but it seems you've identified plugin performance improvements in another thread - so We can close this. Also, class size is greatly improved with 2021.1.25.