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

feat: add virtualization (configurable) #2623

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

audipasuatmadi
Copy link

What/Why/How?

Projects with very large APIs often experience significant lag and frequent crashes when using Redoc. To address this issue, virtualization has been introduced. Virtualization allows elements to be rendered only when they are near the user's viewport, significantly reducing memory consumption for very large API documentation.

Virtualization is made optional because not every project would benefit from enabling it by default. It is advantageous only when the data is large, as it introduces an additional overhead of calculating the virtualization. When the data is not substantial, the drawbacks of this overhead outweigh the benefits.

Benchmark result
Using edge profiler, each recorded in 20 seconds in an OpenAPI docs with 192,076 (190K+) lines
image

Reference

Closes #2615

Tests

Introduced extra unit tests. Results of running all the tests:
image

Screenshots (optional)

Kapture.2024-11-26.at.14.21.22.mp4

Check yourself

  • Code is linted
  • Tested
  • All new/updated code is covered with tests

audipasuatmadi and others added 4 commits November 8, 2024 12:42
* add virtualization to redoc

* address code review, simply stuffs

---------

Co-authored-by: Putu Audi Pasuatmadi <[email protected]>
@audipasuatmadi audipasuatmadi requested review from a team as code owners November 26, 2024 06:43
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

Successfully merging this pull request may close these issues.

Feature Request: Virtualization
3 participants