Performance issues when YAML consists of ~200k LoC
What happens?
I'm the developer of AdonisJS AutoSwagger
I just did some testing on a former project that I used to work on. The yaml of the project produces ~200k LoC (11MB) π and compared the loading times of scalar to rapidoc and the default Swagger-UI.
Scalar: 10 seconds Swagger-UI/rapidoc: ~ 1-2 seconds
Even the sandbox crashes, so I cannot post the example unfortunately
What did you expect to happen?
Load the UI within 1-2 seconds.
How can we reproduce the issue?
Try to get a 200k LoC yaml
Swagger/OpenAPI Example
No response
THANKS for sharing! Weβll look into this. Any chance you can share the file with us? [email protected]
https://adisdurakovic.com/scalar-big.yml
I replaced some model names with Disney characters, to not give out too much real data.
Running into browser tab crashes/hanging when testing with an openapi.json with about ~30K LOC.
In the past with other editors and viewers, this was easily solved/performance drastically improved by rendering tag sections in their own view/page, rather than all on a single view/page. Are there any plans to potentially have a mode for scalar where you could configure that?
Right now, with ~30K LOC, the initial load isn't as big of an issue, but when I select a specific endpoint and it auto-opens the entire models section, is where it goes downhill very fast.
Is that still the case with the latest version? Would be great if you could give it a try.
And is your OpenAPI document public? So great to have more real-world examples.
Testing 1.25.10 and the particular spec with an issue (now about 49K LOC), it has better performance on initial load, however hitting the Test Request button for one of our endpoints causes the browser to say the tab hung, and if I leave it for about 60 seconds, the popup to test the request finally renders. I'll see if I can get an obfuscated version for you.
Update:
Spec URL, some of which has been truncated, but I think it still has the necessary amount of info: https://cdn.liam.sh/misc/examples/openapi-truncated-scalar.json
Example page using 1.25.10, linking to an example endpoint -- if you hit Test Request, you will notice performance issues:
https://cdn.liam.sh/misc/examples/scalar-performance.html#tag/identities/GET/identities
Video also showing this -- this is my high-end personal desktop (16 cores and 64GB of RAM), so it's not terrible, but you'll notice the animation latency when hovering over items on the side, in addition to the delay with test request:
https://cdn.liam.sh/share/2024/09/zen_mspDGu1fr7.mp4
In our work environment, on lower performance laptops, virtual desktops, etc, the performance is terrible (60s+, tab crashing, etc).
Awesome, thanks for sharing this! We should be able to improve this.
Hi, is there any progress on this issue? I am using this file for testing: https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.yaml, and I have encountered a similar problem π€. Thanks.
We definitely improved the performance (just yesterday) and it works fine on my machine now. π Definitely room for improvement, but weβre getting there.
Would you mind to check with the latest version?
Thank you so much for the update and the improvements! π Iβll try it out with the latest version and will provide feedback after testing it thoroughly.