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

Performance issues #171

Open
alvinometric opened this issue Feb 5, 2025 · 3 comments
Open

Performance issues #171

alvinometric opened this issue Feb 5, 2025 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@alvinometric
Copy link

alvinometric commented Feb 5, 2025

Current behavior

Hello,

Great plugin! I've noticed a few performance problems though.

With lighthouse, the performance score was 52 for this page: https://vitepress-openapi.vercel.app/example/operations/getAllArtists.html

Desired behavior

A performance score of 90 or above

Reproduction

https://vitepress-openapi.vercel.app/example/operations/getAllArtists.html

Steps to reproduce

  • Open any page generated by this plugin
  • Open Lighthouse
  • Look at the performance score
@enzonotario enzonotario added the enhancement New feature or request label Feb 5, 2025
@enzonotario
Copy link
Owner

Hi @alvinometric , nice, thanks for bringing this up!

I think it's mainly related to the parsing stage. I'll be working on change the current implementation and trying to use more Scalar packages.

Any additional insights or help are welcome. Thanks!

@alvinometric
Copy link
Author

Should the parsing not happen during SSR at build-time ?

@enzonotario
Copy link
Owner

enzonotario commented Feb 8, 2025

Yes, it's "just" some Vue components on top of VitePress, so all SSR Compatibility applies here.

However, there are still some processes it needs to handle, such as:

  • Parsing and Dereferencing the OpenAPI file to determine Parameters, Request Body, Responses, with their respective types, constraints, etc.
  • Generating Examples of Request Body and Responses
  • Generating Code Samples for each language

This isn't meant as a justification, but rather to provide context.

That said, when checking Lighthouse score for Galaxy Scalar, it's almost the same as vitepress-openapi One Page, which makes me think the performance is something a bit harder to achieve when dealing with OpenAPI files.

Image

Image

Image

That being said, I'm currently working on #172 (and future PRs) to centralize the logic in some Feature Components, integrate Scalar Parser, and then work on performance improvements.

I'm also open to suggestions on how to improve performance, so feel free to share your thoughts!

@enzonotario enzonotario added the help wanted Extra attention is needed label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants