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

CW-375: Excessively long solutions cause performance problems in browsers #3140

Open
hobovsky opened this issue Jan 11, 2024 Discussed in #3108 · 3 comments
Open

CW-375: Excessively long solutions cause performance problems in browsers #3140

hobovsky opened this issue Jan 11, 2024 Discussed in #3108 · 3 comments
Labels
area/solutions-list jira-escalated Escalated to engineering Jira board by Andela team

Comments

@hobovsky
Copy link

Discussed in #3108

Originally posted by kirillFedorov1 November 28, 2023
Consider concealing solutions that are excessively long, such as those that span thousands of lines and are often submitted as "funny" solutions. These submissions can cause significant performance issues, freezing web browsers and creating a frustrating environment when attempting to view other, more serious solutions.

For instance, after completing the kata You can't code under pressure #1, I encountered an issue where my laptop was unable to load the solutions page at all.

@hobovsky
Copy link
Author

hobovsky commented Jan 11, 2024

Similar problem was reported on Discord. The root of the issue is most probably very CPU-intensive syntax highlighting which attempts to color tens of thousands of lines with a comment in a browser, freezing it. The user got locked out of the "Solutions" tab on their profile page because their browser froze every time they attempted to see their recent solutions.

@Voileexperiments
Copy link

Voileexperiments commented Aug 7, 2024

I disagree with the connotations from your wordings that "shorter = more serious". You seem to imply that excessively long solutions are always posted out of comedic/trollish intent; but typical solutions are not long enough to cause browser hiccups, and solutions long enough to cause hiccups are almost always by putting data as code, which says more about the kata's inadequacies. If someone doesn't like solutions are hardcoding data, enforce a code size limit. Trying to discourage this by bullying/harassing solutions doing this by saying bad words about it (yes, this happens a lot) is unacceptable.

Anyways, concealing solutions entirely is just ridiculous, it categorically discriminates long solutions for being long by putting a bad light onto them ("look how long solutions is concealed by default, they're clearly Bad:tm:!"). "Clever" button is already used by lots of users to discriminate solutions they don't like, so please don't add more such inconsiderate features. Please make sure any solutions of this is universal across all solutions and doesn't cause potential discrimination, such as

  • In solution list, make all solutions display only the first 1000(TBD) characters and 10(TBD) lines by default
  • Add a "Expand" click area at the bottom of the code box. Clicking it fills the code box with the full solution and expands it
  • In individual solution page, just display the full solution

@error256
Copy link

error256 commented Aug 7, 2024

It looks like there's something about highlighting that Chromium doesn't like. Firefox loads huge solutions in under a minute on an old PC where a minute seems a more or less acceptable time for that (comparable to discourse pages with a lot of comments), while Brave hangs forever.

@VanessaGreene VanessaGreene added the jira-escalated Escalated to engineering Jira board by Andela team label Aug 13, 2024
@VanessaGreene VanessaGreene changed the title Excessively long solutions cause performance problems in browsers CW-375: Excessively long solutions cause performance problems in browsers Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/solutions-list jira-escalated Escalated to engineering Jira board by Andela team
Projects
None yet
Development

No branches or pull requests

4 participants