Redocly / Redocly/redoc

Performance issue with long search query string that potentially has matching results

Open
#2,378 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

investigation Type: Bug
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

I am using the standalone js provided on the home page (https://cdn.redoc.ly/redoc/v2.0.0/bundles/redoc.standalone.js).

I notice when searching with long query strings that have matching candidates, the ui becomes very slow and even completely stops responding or crashes. I'm using Chrome.

One thing I found is if I disable diacritics (looks like related to a certain type of regexp) in 'redoc.standalone.js' (by setting it to !1 instead of !0) the error disappears, and performance is significantly improved.

I cannot find diacritics in the codebase. So, I suppose it's from some library? Can you please advise if it's a known issue and if there's any solution for it? Please let me know if you require more clarification. Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the slowdown in Chrome using a long query with matching candidates against the standalone js bundle from the home page. Compare behavior with diacritics enabled and disabled, then trace where diacritics enters the bundle or its dependency. Done means the search remains responsive for the reported case and the fix is verified against a regression scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.