honestbleeps / Reddit-Enhancement-Suite

Reddit Enhancement Suite
http://redditenhancementsuite.com
GNU General Public License v3.0
4.17k stars 879 forks source link

Extreme slowdown #3338

Closed nickcano closed 7 years ago

nickcano commented 8 years ago

After the most recent update (seems like today), I'm experiencing a massive slowdown.

Browser: Chrome Resolution: 4k, 150% zoom Night mode enabled, images shown

Before, I could scroll into the 800's before experiencing a frustrating amount of lag. Now it starts around 100~150.

My specs are far more than substantial. 4.9GHz, 8 cores, 32gb ram, R9 290x.

larsjohnsen commented 8 years ago

Could you take a screenshot of the CPU profile of you scrolling while experiencing the slowdown?

Sort by self time. Should look similar like this: screenshot_2016-09-02_20-28-03

nickcano commented 8 years ago

It seems to be a memory leak. If I leave the tab open with no activity at #126 (sorry, forgot how many items per page), and I watch either Windows or Chrome task manager, I see it gaining, on average, 200k per refresh (seems like a 1-second refresh interval). CPU climbs as the memory climbs, but I'm having a hard time finding by how much. May be irrelevant and just related to chrome's heavy memory manager.

One other detail is that the leaks seem to climb up 300MB~500MB before dropping back down to a predictable baseline, so it seems like garbage collection is taking over at some point. Afterward, It keeps climbing until the next drop, though restask1 res2

I wanted to attach the entire profile file but it can't be attached to this message, is too long to post, and doesn't fit on pastebin. Let me know if you have any preferred way for me to upload it.

larsjohnsen commented 8 years ago

I see that something called injected.js is what is causing the slowdown. It is not a RES-file, so it is likely some other extension not playing nicely along. If you go to the 'Sources` tab, you'll able to find what extension contains that file.

Edit: It may not be an extension file, but rather Tampermonkey injecting some resource.

nickcano commented 8 years ago

Must be a plugin that doesn't like the new version of RES. I'll track it down, thanks, should have checked that myself first. doh!

jewel-andraia commented 8 years ago

Once you figure it out, it'd be great to hear back and maybe help some other people debug slowdowns.

pmcanseco commented 8 years ago

I'm getting similar symptoms to OP and I'd like to add that I've been monitoring CPU usage while scrolling (night mode, images shown). It appears that CPU usage climbs higher and higher the further down one scrolls. At around 400, my CPU usage remains at 100% until I close my Reddit/RES tab. I have found that collapsing gifs as I scroll completely mitigates the issue, with CPU usage never going above 15~25%.

Is it possible to optimize the way gifs that aren't in view are handled by RES such that they aren't impacting the CPU?

Specs: 4.2 GHz, 16GB RAM, R9 290x GPU Not using any other extension on reddit.com behinds RES. If it helps: CPU Profile while scrolling: image

honestbleeps commented 8 years ago

@pmcanseco - do you have the conserveMemory option turned on, or off?

pmcanseco commented 8 years ago

I have it turned on: image

I also have bufferScreens set to 2. I have not yet tried changing this setting but I will and report back.

larsjohnsen commented 8 years ago

@pmcanseco Auto-unload of videos is in the works. #3412

kevinji commented 7 years ago

Closing for now, as no continued issues have been reported. If this is still a problem, feel free to reopen.