0

I'm experiencing lagging on my linux laptop.

For example, sometimes, when I switch tabs by clicking in the browser, the click doesn't get registered for around 5 seconds and then the webpage itself loads 5 more seconds. Sometimes when I type in my text editor the symbols and the edits appear some 2 seconds later. Please help me figure out why that is.

I am running an arch-based distro on a 2014 MacBook Pro, with lxqt/i3 (which I consider to be pretty lightweight - no overhead there), I tested this behavior in my main Firefox with a lot of extensions and on a clean install of Firefox - same lagging persists. I am also running power-profiles-deamon and switched to the balanced profile (didn't help too). I am also monitoring cpu frequency with bpytop - it is all over the place (800MHz-2.0GHz-3.1GHz), but the CPU load is always around 10-20% and the temps are around 60-70C. I have a fan manager daemon running and the fan spins under heavy load.

I am on a WiFi connection right now, and can't test the browser behavior with a wired connection (but I'm sure the editor has nothing to do with connection speed).

I would like to know, how to make the laptop perform these tasks faster (at a higher clock speed, possibly with a higher load and at the expense of battery life which I don't care about). My boot clock is 3.4GHz.

1 Answer 1

0

This doesn't sound like a CPU issue, at all! Your load observations also say it isn't CPU. So let's drop that idea.

How many tabs are there, and is the tab you're switching too potentially very RAM intense? This all simply sounds like your system has to juggle too many tabs, which means storing the (often GB-sized) state of tabs in RAM – and when you switch between tabs, brings the tab "back to live". (This might involve a complicated dance to fully restore the state of a rather complicated piece of software. We collectively need to stop thinking of websites as documents displayed in our browsers, but as very complicated pieces of software modifying what is displayed in the browser.)

This is usually astonishingly fast (if you realize what's happening beneath the surface), but becomes slow the moment you run out of RAM and your operating system has to take parts of your RAM and store it to disk/SSD, which is orders of magnitude slower than RAM.

You can check which tabs use how much RAM (and CPU), by going into Firefox's "burger menu", open "more tools", go to "Task Manager".

Open a terminal and ask free -g how much memory you have in "Swap". That's the amount of memory stored to disk.

2
  • Thank you for your answer! My most memory-heavy tab weighs around 130MB. My swap usage is 0 bytes at all times, as I have 16GB of RAM. The behavior I can't explain is why the browser doesn't register the click on the tab - so it doesn't highlight the tab on hover and the tab background doesn't change color to "active" (a lighter grey) until after 5 seconds after click. And then the page starts loading - the "loading" rotating circle indicator appears and UI elements start appearing. This is the part I suspect where the tab is "brought to life" - load from disk or from network happens. Commented Mar 3, 2022 at 11:12
  • Also, strangely enough, I've restored to a timeshift backup and the system works great. My suspicions were that either ActivityWatch or logseq were causing this. The backup was before these programs were installed, so my suspicion might have been correct. I, however, still don't understand what the cause for this behavior was. My behavior now is: I click a tab, and, without the 5 second delay, the tab starts loading. It takes some time, but the progress is visible and this is what I'm used to and what I expect. Commented Mar 3, 2022 at 11:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.