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
Reports of code editor performance degrading over time #54736
Comments
I've experienced this issue multiple times. After the donation pop-up appears, the performance of the website becomes laggy. Even after refreshing the page, it returns to normal temporarily, but the lag returns once the donation pop-up reappears. Note: the lag doesn't occur immediately after the pop-up, it becomes noticeable as you continue solving challenges, with delays in typing and overall slowness. |
I have not noticed this in the dev environment, even if the pop-up is present there too (python course) |
I thought I was crazy or that my machine was "too old" for this, but I have experienced this too. In my experience, it has happened after working a while on the editor or just doing a little bit of work on the editor, leaving it open, and then coming back. It becomes really slow and the only workaround that I have found is closing my browser completely and opening it again. Note: As a current donor, the pop-up doesn't show up in my account and I don't think is related to that component itself. |
Commenting to add I experience this every single time I use the editor for more than maybe 20 minutes. It doesn't just happen suddenly. It starts with a slight delay then gets worse and worse. I just opened up Incognito with no extensions enabled, and I noticed the delay after around 15 minutes. Then by 25 minutes it was definitely worse. It isn't unusable, but if you type relatively quickly it is very noticeable that words on screen are being completed maybe 100ms after you actually type them, then gets a little worse from there. Info: |
I'm able to get the slowdown both in production and in development. Reproducing it a bit loosely:
Recorded performance showed then longer times of redux updates coming from (if I didn't mix up anything) the editor's freeCodeCamp/client/src/templates/Challenges/classic/editor.tsx Lines 867 to 895 in 4270793
|
Thanks, @gikf that's really helpful! Just so I'm on the same page: how did you record the performance and did you have campfire mode on while you were testing this? Also, did you complete and submit 20 steps or just navigate through them? |
Hey @ojeytonwilliams!
|
It's not easy to read, but it does seem to be I've yet to see the slowdown from
I'll try completing a lot of challenges next and see if I see what you saw, @gikf. Regardless, it seems like either the amount of typing you need to do to complete a bunch of challenges OR the completion/submission process is the problem. That's my current guess. |
I'm seeing the same code editor latency after about 5 to 10 minutes of usage. I see it both in Chrome and Firefox browsers when testing in Windows 11 and Linux Fedora 40. The best solution I have is to do a force cache reload of the page when it starts happening. Is the code editor overloading the cache to cause a slow down? |
I'm on Windows Chrome browser and the editor is super slow for me. I type and I can't see what I've typed in till seconds later (good thing I'm a good typist) and I click Submit and it takes a long pause to respond. I tried clearing cache but it fixes the issue for maybe a couple of steps max then back to the slow performance. Definitely something I didn't experience back in early 2023 when I last used the curriculum. If there's some data I can collect to help debug, let me know. (Edit: i switched to MS Edge which I didn't use for fcc work before and the issue disappeared for the first 10 steps i tried). I may continue here for a bit before retrying chrome again at some point.) 2nd Edit: the performance improvement didn't last. Same issue occurred after a few more steps and I persisted for a couple more of these slow steps just to see if anything would change, but nothing did. So I logged off and switched back to Chrome. First few steps are back to normal performance at this point. Perhaps the pattern will repeat (and things will slow down momentarily at which point I will try another browser switch). |
Hi all, thank you for reporting the issue. We are trying to reproduce the issue, but no luck yet. From what I gather, the issue can happen:
I guess what's left is the challenge pages that you are on when you experience the issue. I personally have tried going through 50+ Python challenges of the Building a Cipher project, and I haven't experienced the lag. We have one user experienced the issue with the Responsive Web Design challenges (#54736 (comment)), so maybe this is where I'd try next. But we would love to get more information from everyone else: which page / course you were on when you experienced the issue. Thanks again for reporting. |
The lag happens consistently to me on the Role Playing Game project (js beta) pages. Everytime I recycle my browser the issue goes away temporarily. (Or if I close the tab on edge and reopen it) |
As I have already commented, I experienced this throughout the responsive web design cert, but I have since finished that course and moved onto the JavaScript one, and can confirm I am having the exact same issue on there. The easiest way I've found to get rid of the delay is |
It might be needed for user to be logged in. I've tried to reproduce it on Firefox.
|
I also see it when logged in. It literally became so bad that is spiked the CPU if I held down a key and just let it repeat. It might somehow be related to the completion modal in the lower jaw, but I'm really not certain. That is at least also different depending on if you are signed in or not. The problem is, it didn't seem as bad in dev mode for me, so I'm not confident. But I removed the progress component and did twice as many steps, and it didn't happen. But as said, I'm really not sure if I trust it in dev mode. In the Performance log, looking at the bottom-up tab, |
Thanks everyone. I've finally reproduced it by doing ~20 responsive web design lessons while signed in. It does seem like My plan is to create a quick PR to stop the unnecessary calls and/or memoize the function. Hopefully that fixes it, but we'll have to see. |
@ojeytonwilliams I was briefly looking at the Progress component and saw ProgressInner
Something about that code doesn't sit right with me. The If I just log when the component renders, it does so on every keystroke, and even just left-clicking inside the active editor section logs a re-render. This is after you have completed at least one challenge step. Might not be related, but it doesn't seem right considering it isn't even shown. I'm a little skeptical of the Intersection observer and useEffect. I know this isn't very constructive, but that's all I've got for now. |
I agree about the naming, it's a little sloppy. And, yes, something is going wrong meaning that it's getting re-rendered after challenge completion. #54925 makes it a lot better, though. It's still rendering when you start a new challenge (and it shouldn't), but it no longer renders in response to, well, everything. |
Describe the Issue
Opening for visibility.
I have not seen this happen myself, but I also haven't spent much time in the editor.
Link to threads reporting this.
https://forum.freecodecamp.org/t/code-editors-performance-degrades-over-time/685239
Affected Page
https://www.freecodecamp.org/learn/
Steps to Reproduce
Unknown, I guess usage over time.
Expected behavior
Performance not degrading over time.
Screenshots
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: