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

Lots of time of the OpenAPI conversion spent in removeShapes #2556

Open
kubukoz opened this issue Mar 6, 2025 · 1 comment
Open

Lots of time of the OpenAPI conversion spent in removeShapes #2556

kubukoz opened this issue Mar 6, 2025 · 1 comment

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Mar 6, 2025

Hi! I had a brief look at profiling our code to see what takes the most time in the build process. One of the things we do in that process is building OpenAPI for a bunch of services. That's actually the longest part of the process, at the moment.

One thing stood out to me - there are two removeShapes calls in the call tree, which together take ~54% of the OpenAPI conversion - 324 seconds for the whole thing (we parallelize this by service, but that only gets us so far).

Image

I wonder if there are some optimization opportunities in there. Here's a breakdown ofremoveShapes:

Image

I wonder if there's something obvious we could do about CleanStructureAndUnionMembers.

@kubukoz
Copy link
Contributor Author

kubukoz commented Mar 6, 2025

Now that I think of it... as your model grows and you have more services, computing scoped models by removing shapes is a hopeless cause - it'll just get consistently slower as more shapes are added.

Shouldn't the scopeModelToService be changed to use a builder that only adds the shapes the service still refers to? That seems much easier than trying to optimize here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant