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

Search crashes my browser (on docs.sqlalchemy.org) #8562

Closed
Dreamsorcerer opened this issue Dec 20, 2020 · 1 comment · Fixed by #8868
Closed

Search crashes my browser (on docs.sqlalchemy.org) #8562

Dreamsorcerer opened this issue Dec 20, 2020 · 1 comment · Fixed by #8868

Comments

@Dreamsorcerer
Copy link

When I use the search functionality on docs.sqlalchemy.org it typically starts displaying a huge number of results which in only a couple of seconds results in using GBs of RAM, which then results in my browser crashing when the system runs out of memory.

The documentation is created with Sphinx.

I guess an obvious solution would be to implement pagination, rather than loading unlimited amount of results in the page.

Firefox on Linux.

docs.sqlalchemy.org may be a special case here, as the documentation is so big it's pretty common to get a huge number of search results.

See also: sqlalchemy/sqlalchemy#5790

@Dreamsorcerer Dreamsorcerer changed the title Search crash my browsers (on docs.sqlalchemy.org) Search crashes my browser (on docs.sqlalchemy.org) Dec 22, 2020
@tk0miya
Copy link
Member

tk0miya commented Dec 25, 2020

For example, I searched "sql" on sqlalchemy project. And I got 4746 entries at once.

Search finished, found 4746 page(s) matching the search query.
https://docs.sqlalchemy.org/en/13/search.html?q=sql&check_keywords=yes&area=default#

And it makes the page very huge with heavy loop. I guess this wastes CPU and RAM.

I think it would be better to add a threshold to stop listing search-result. I believe nobody sees the 4000th item.

emilio added a commit to emilio/sphinx that referenced this issue Feb 10, 2021
Fixes a performance issue with massive lists like sphinx-doc#8562.

jQuery.slideDown is pretty bad perf-wise since it thrashes layout
multiple times.

The 5ms animation is unnoticeable (it last less than an animation
frame!) and just burns CPU cicles unnecessarily in all browsers.

On Firefox this is specially bad because it hits a performance cliff
with list items / CSS counters
(https://bugzilla.mozilla.org/show_bug.cgi?id=1683910#c26 for all the
gory details) where it causes tons of counter recalc.

An alternative fix for the Firefox cliff would be to set overflow:
hidden on the list item, but I think removing the animation is probably
more sensible, given that as I said it's just burning CPU.

Fixes sphinx-doc#8562
emilio added a commit to emilio/sphinx that referenced this issue Feb 10, 2021
Fixes a performance issue with massive lists like sphinx-doc#8562.

jQuery.slideDown is pretty bad perf-wise since it thrashes layout
multiple times.

The 5ms animation is unnoticeable (it last less than an animation
frame!) and just burns CPU cycles unnecessarily in all browsers.

On Firefox this is specially bad because it hits a performance cliff
with list items / CSS counters
(https://bugzilla.mozilla.org/show_bug.cgi?id=1683910#c26 for all the
gory details) where it causes tons of counter recalc.

An alternative fix for the Firefox cliff would be to set overflow:
hidden on the list item, but I think removing the animation is probably
more sensible, given that as I said it's just burning CPU.

Fixes sphinx-doc#8562
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants