1

I have a laptop using Intel Core i3-7130U CPU and Intel UHD Graphics 620 GPU. Also using an SSD.

On Windows 10, it flies. Animations are smooth, and programs launch instantly.

On Ubuntu 20.04 and 20.10, it’s sluggish. Everything takes a couple more seconds to launch. Kdenlive is super slow when previewing.

I tried Xanmod, Liquorix, the latest oibaf drivers. Nothing really worked.

My question is: with the same specs, why is Ubuntu slower? And is there a good fix to this problem? Thank you!

facialrecognition
  • 435
  • 2
  • 6
  • 12
  • I'm on Gnome Ubuntu 20.04, on a relatively strong processor & slowish SSD. I can say, specifically the "Settings" app has always been starting very slow. (It does some massive disk read before each time it opens.) Then like two weeks ago Firefox suddenly became extremely slow to start: 6-7 seconds instead of the earlier instantaneous. I have read comments from others that Chrome or Nautilus might also get impacted. But these new things, I believe / hope, are some temporary glitch that they will find the cause of and fix in a future release. (I mean it can't stay like that, it's unacceptable.) – Levente Apr 01 '21 at 15:43
  • Unfortunately no. If I can run Windows 10 just fine with all its bloat, why can’t I run GNOME? Is GNOME more resource-intensive than Windows 10? Thank you. – facialrecognition Apr 01 '21 at 16:05
  • What laptop brand and model? There have been a few similar questions in just the last day. – Doug Smythies Apr 01 '21 at 16:11
  • Dell Inspiron 3567. Replace HDD with SSD, though. Thanks for your help. – facialrecognition Apr 01 '21 at 16:40
  • Edit your question and show me free -h and sysctl vm.swappiness and a screenshot of the Disks "SMART Data & Tests" data window (scrollable window may require two screenshots). Start comments to me with @heynnema or I'll miss them. – heynnema Apr 01 '21 at 17:00
  • Something is wrong. I've never had a slower Ubuntu than Windows -ever. Have you installed a special graphics driver? That is usually the bottleneck. UHD Graphics 620 GPU should work without latency – kanehekili Apr 01 '21 at 17:49
  • @heynnema Here is a pastebin showing lots of system info, including ones for your commands! Here are the screenshots too. – facialrecognition Apr 01 '21 at 18:46
  • @kanehekili I know! I'm not sure why my Ubuntu is slower. Originally, I was using defaults, and it was slow. Things didn't change much either with oibaf's drivers or different kernels like Liquorix or Xanmod. – facialrecognition Apr 01 '21 at 18:50
  • The swap may be a little small, but we'll come back to that. Is the system fast after you first boot it, and then slows down with use? When the system is slow, show me a screenshot of the top command. – heynnema Apr 01 '21 at 19:13
  • 1
    @heynnema Yes! At the very first boot after installation, it's fast. Then, as I begin to use it, it starts to slow down. And under pressure, it collapses (as in, it can freeze or stutter). – facialrecognition Apr 01 '21 at 19:44
  • Good! Now, when it slows down, show me top and free -h (again), and grep -i swap /etc/fstab. – heynnema Apr 01 '21 at 19:45
  • @heynnema https://pastebin.com/raw/kgR8EKxY – facialrecognition Apr 03 '21 at 00:01
  • @facialrecognition Thanks for the new data. Was that taken when the system was acting slow? Quit all of your open apps... Firefox, Terminal, etc and then do top again, and see if gnome-shell is using ~3% of CPU with no mouse movements. – heynnema Apr 03 '21 at 00:34
  • @facialrecognition Try my answer and report back. – heynnema Apr 03 '21 at 00:38
  • @heynnema Yes! It uses 3.3%. And I don't know what kind of magic this is, but my computer already feels much snappier than before! Can I double the swapfile yet again, or is that not good? – facialrecognition Apr 03 '21 at 00:51
  • @facialrecognition More than 4G /swapfile is probably not necessary. If you continue to operate ok, please remember to accept my answer by clicking on the checkmark icon that appears just to the left of my answer. Thanks! – heynnema Apr 03 '21 at 00:54
  • @heynnema No, thank you!! Accepted as best answer :) – facialrecognition Apr 03 '21 at 01:20

1 Answers1

4

Let's see if we increase your /swapfile from 2G to 4G if that helps...

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

In the terminal...

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections sudo mkswap /swapfile # init /swapfile sudo swapon /swapfile # turn on swap free -h # confirm 8G RAM and 4G swap

Edit /etc/fstab, using sudo -H gedit /etc/fstab or sudo pico /etc/fstab.

Confirm this /swapfile line in /etc/fstab... and confirm no other “swap” lines... use SPACES in this line... confirm NO TABS...

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation
heynnema
  • 70,711
  • In the list of commands, all other commands are labelled, but what does this specific dd command achieve? – Levente Apr 03 '21 at 00:56
  • @Levente dd actually builds the /swapfile. I didn't comment it because there wasn't enough room to make it look pretty. For more info do man dd in the terminal. – heynnema Apr 03 '21 at 00:58
  • I think the part I'm lost is at /dev/zero. To me it seemed that dd copies something out of /dev/zero, and "pre-populates" the swapfile with it. I looked at this: https://en.wikipedia.org/wiki//dev/zero So the swapfile cannot be used unless it's "inflated" first to its working size? In this regard, obviously, it differs from other files that I have encountered. That's the interesting part :) – Levente Apr 03 '21 at 01:01
  • 1
    There's a reference in the man pages for swapfile creation, that if a sparse file is used, on some filesystems it may fail. Using dd to copy all zeros (/dev/zero) into the file ensures that the file is non-sparse. It may not be required on an ext4 filesystem, but it's good practice – Charles Green Apr 03 '21 at 04:12
  • It is a good idea to make the swapfile non-sparse (using dd from /dev/zero) because if it starts sparse and is populated incrementally, it might end up being a bunch of non-contiguous fragments that would be slow. Assuming that sparse swap files work at all, which they didn't use to. – user10489 Nov 13 '21 at 23:20