redoc icon indicating copy to clipboard operation
redoc copied to clipboard

feat: add virtualization (configurable)

Open audipasuatmadi opened this issue 1 year ago • 0 comments

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)

https://github.com/user-attachments/assets/ecda9bec-7abc-469e-aaac-b86eea30cfe4

Check yourself

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

audipasuatmadi avatar Nov 26 '24 06:11 audipasuatmadi