Reduce File Size of Providers SDKs #11668
Labels
area/codegen
SDK-gen, program-gen, convert
impact/performance
Something is slower than expected
kind/engineering
Work that is not visible to an external user
language/dotnet
language/go
language/java
language/python
language/yaml
size/L
Estimated effort to complete (up to 10 days).
Hello!
Issue details
In our various languages, generated code can create very large files. Large file sizes can crush IDEs. When IntelliJ or another editor opens a file, it usually opens and buffers the entire file and launches some kind of LSP to show possible errors. This can consume a lot of memory and be very slow, both for responsiveness and for auto-completion.
There are two ways to think about this issue:
Lastly, we need to consider which languages are the biggest offenders and why.
types
directory, which we're addressing. See the original issue and the tracking issue for the fix.Each language has a unique directory structure, so the reason for large files is different for each language.
We should set a target SLO of 20MB max for file size. (based on customer discussion)
Discussion
Targetting the Worst Offenders: IMO we should carry on with the approach we're using for NodeJS. In Node, we found an instance where files are massive . In #8613 we identified that the
types
directory is 77MB, andtypes/input.ts
is 30MB whiletypes/output.ts
is 37MB. That's unacceptably large. We decided to split these files into smaller files. Using a targetted approach here allows us to be more strategic about how we fix these performance bugs.This is probably easy in Go, since we can split files arbitrarily within a package without affecting scope. Java and Dotnet might be the same, although we likely need to add extra import statements, which could be a challenge. Node may very well not be an issue.
Max File Size: I'm not too fond of this design. It would be challenging to generate meaningful names automatically. If we split along an arbitrary boundary, then we need some way to name both files. I'm not sure this is really a meaningful split. Splitting arbitrarily makes it harder to inspect the source since there's no rhyme or reason to the filesystem layout.
Action Items
We need to gather intel about which files are the biggest and why. Then, we can decide if we can be strategic or not.
Progress Tracker
Affected area/feature
Codegen for NodeJS, Dotnet, Go, Python, Java, and YAML.
The text was updated successfully, but these errors were encountered: