fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10.28k stars 399 forks source link

Fastfetch is slower than Neofetch #634

Closed flipflop133 closed 10 months ago

flipflop133 commented 10 months ago

General description of bug:

I think it's slowing down when trying to display the shell informations.

Comparison image

image

Often helpful information:

The content of the configuration file you use (if any)

used the default command without any configuration

Output of env NO_CONFIG=1 fastfetch --load-config all --show-errors --stat --multithreading false --disable-linewrap false --hide-cursor false:

$ env NO_CONFIG=1 fastfetch --load-config all --show-errors --stat --multithreading false --disable-linewrap false --hide-cursor false
                  -`                     francois@fox                                                                                             0ms
                 .o+`                    ------------                                                                                             3ms
                `ooo/                    OS: Arch Linux x86_64                                                                                    0ms
               `+oooo:                   Host: 82FG (IdeaPad 5 15ITL05)                                                                           0ms
              `+oooooo:                  Bios (UEFI): FHCN72WW (1.72)                                                                             0ms
              -+oooooo+:                 Board: LNVNB161216 (SDK0J40709 WIN)                                                                      0ms
            `/:-:++oooo+:                Chassis: Notebook (IdeaPad 5 15ITL05)                                                                    0ms
           `/++++/+++++++:               Kernel: 6.6.2-arch1-1                                                                                    0ms
          `/++++++++++++++:              Uptime: 54 mins                                                                                          0ms
         `/+++ooooooooooooo/`            Processes: 296                                                                                           1ms
        ./ooosssso++osssssso+`           Packages: 824 (pacman)                                                                                   1ms
       .oossssso-````/ossssss+`          Shell: bash 5.2.21                                                                                     100ms
      -osssssso.      :ssssssso.         Display (BNQ78F5): 2560x1440 @ 60Hz                                                                    478ms
     :osssssss/        osssso+++.        Brightness (BOE08E2): 0%                                                                                 0ms
    /ossssssss/        +ssssooo/-        Monitor (BOE08E2): 1920x1080 px - 344x194 mm (15.55 inches, 141.68 ppi)
  `/ossssso+/:-        -:/+osssso+-      Monitor (BNQ78F5): 2560x1440 px - 597x336 mm (26.97 inches, 108.90 ppi)                                  0ms
 `+sso+:-`                 `.-/+oso:     LM: login (TTY)                                                                                          0ms
`++:.                           `-/+/    DE: No DE found                                                                                          0ms
.`                                 `/    WM: i3 (X11)                                                                                             0ms
                                         WM Theme: Unknown WM: i3                                                                                 0ms
                                         Theme: Adwaita [GTK3/4]                                                                                  0ms
                                         Icons: Papirus-Light [GTK3/4]                                                                            0ms
                                         Font: Open Sans (12pt) [GTK3/4]                                                                          0ms
                                         Cursor: Bibata-Modern-Classic                                                                            0ms
                                         Wallpaper: Failed to detect the current wallpaper path                                                   0ms
                                         Terminal: kitty 0.31.0                                                                                   0ms
                                         Terminal Font: JetBrainsMonoNF-Regular (14pt)                                                          126ms
                                         Terminal Size: 150 columns x 36 rows (2550px x 1332px)                                                   0ms
                                         CPU: 11th Gen Intel(R) Core(TM) i7-1165G7 (8) @ 4.70 GHz                                                 0ms
                                         CPU Usage: 6%                                                                                            0ms
                                         GPU: Intel Iris Xe Graphics                                                                              9ms
                                         Memory: 4.13 GiB / 15.42 GiB (27%)                                                                       0ms
                                         Swap: 0 B / 4.00 GiB (0%)                                                                                0ms
                                         Disk (/): 57.55 GiB / 476.42 GiB (12%) - btrfs                                                           0ms
                                         Battery: 44% [Charging]                                                                                  0ms
                                         Power Adapter: Not supported on this platform                                                            0ms
                                         Media Player: No media found                                                                             3ms
                                         Media: No media found                                                                                    0ms
                                         Public IP:                                                                   204ms
                                         Local IP (wlan0): 192.168.0.13/24 *                                                                      0ms
                                         Wifi: kot_mercier - 802.11ax (Wi-Fi 6) - WPA2                                                           28ms
                                         Date & Time: 2023-11-27 12:22:02                                                                         0ms
                                         Locale: en_US.UTF-8                                                                                      0ms
                                         Vulkan: 1.3.255 - Intel open-source Mesa driver [Mesa 23.2.1-arch1.2]                                   13ms
                                         OpenGL: 4.6 (Compatibility Profile) Mesa 23.2.1-arch1.2                                                 26ms
                                         OpenCL: clGetPlatformIDs returned 0 platforms                                                            0ms
                                         Users: francois - login time 2023-11-27T11:40:48+0100                                                    0ms
                                         Bluetooth: No bluetooth devices found                                                                    1ms
                                         Sound: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 1 Output (49%)           5ms
                                         Gamepad: No devices detected                                                                             0ms
                                         Weather: +2°C - Partly cloudy                                                        111ms
                                         Network IO (wlan0): 2.32 KiB/s (IN) - 1.41 KiB/s (OUT)                                                   0ms
                                         Disk IO (SKHynix HFS512GD9TNI): 0 B/s (R) - 0 B/s (W)
                                         Disk IO (name): 0 B/s (R) - 0 B/s (W)                                                                    0ms
                                         Version: fastfetch 2.2.3-84 (x86_64)                                                                     0ms
                                                                                                                                                  0ms
                                         ████████████████████████
                                         ████████████████████████                                                                                 0ms

Output of fastfetch --list-features:

threads
libpci
vulkan
wayland
xcb-randr
xcb
xrandr
x11
gio
dconf
dbus
imagemagick7
chafa
zlib
xfconf
egl
glx
osmesa
opencl
libpulse
libnm
CarterLi commented 10 months ago

Fastfetch detects more by default. Try fastfetch -s Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Terminal:CPU:GPU:Memory:Break:Colors --ds-force-drm

flipflop133 commented 10 months ago

Ok, I thought it would be faster by default as stated in the package description, I guess my assumption was wrong, but still as it's written in C it should in theory display at least the same items faster, it feels like it's slowing down retrieving one item. Still when displaying the same items Neofetch is still faster.

image

And using --ds-force-drm is indeed faster but doesn't show the same options:

image
CarterLi commented 10 months ago

Do you have 2 displays?

flipflop133 commented 10 months ago

Yes I do.

CarterLi commented 10 months ago

But why only BNQ78F5 was detected previously?

flipflop133 commented 10 months ago

Indeed, when I disconnect the second display it's much faster:

image

EDIT: when I'm using two displays, I'm just connecting my laptop to my BenQ monitor and displaying only on the BenQ monitor.

flipflop133 commented 10 months ago

But why only BNQ78F5 was detected previously?

No idea, I didn't changed the setup except for my last message.

CarterLi commented 10 months ago

What if you open both two?

flipflop133 commented 10 months ago

It takes a bit more time:

image
CarterLi commented 10 months ago

Compare to neofetch? You should use --stat to display the time costs.

CarterLi commented 10 months ago

Wait. I see that fastfetch prints 4.7 GHz CPU freq, while neofetch prints 2.8 GHz. Which one is correct?

flipflop133 commented 10 months ago
image image

it seems that it's slowing down detecting the monitors.

flipflop133 commented 10 months ago

Wait. I see that fastfetch prints 4.7 GHz CPU freq, while neofetch prints 2.8 GHz. Which one is correct?

4.7Ghz is the maximum freq aka boost freq, while 2.8Ghz is the base freq, so there's no "correct" one here. While I would say 4.7GHz is what the user would expect here, so fastfetch is correct imo.

More info on my processor here.

CarterLi commented 10 months ago

What does fastfetch --format json print?

flipflop133 commented 10 months ago
[
  {
    "type": "Title",
    "result": {
      "userName": "francois",
      "hostName": "fox",
      "homeDir": "/home/francois/",
      "exePath": "/usr/bin/fastfetch",
      "userShell": "/bin/bash",
      "pageSize": 4096
    }
  },
  {
    "type": "Separator",
    "error": "Unsupported for JSON format"
  },
  {
    "type": "OS",
    "result": {
      "buildID": "rolling",
      "codename": "",
      "id": "arch",
      "idLike": "",
      "name": "Arch Linux",
      "prettyName": "Arch Linux",
      "variant": "",
      "variantID": "",
      "version": "",
      "versionID": ""
    }
  },
  {
    "type": "Host",
    "result": {
      "family": "IdeaPad 5 15ITL05",
      "name": "82FG",
      "version": "IdeaPad 5 15ITL05",
      "sku": "LENOVO_MT_82FG_BU_idea_FM_IdeaPad 5 15ITL05",
      "sysVender": "LENOVO"
    }
  },
  {
    "type": "Kernel",
    "result": {
      "architecture": "x86_64",
      "name": "Linux",
      "release": "6.6.2-arch1-1",
      "version": "#1 SMP PREEMPT_DYNAMIC Mon, 20 Nov 2023 23:18:21 +0000",
      "displayVersion": ""
    }
  },
  {
    "type": "Uptime",
    "result": {
      "uptime": 8858330,
      "bootTime": 1701098589637
    }
  },
  {
    "type": "Packages",
    "result": {
      "all": 824,
      "apk": 0,
      "brew": 0,
      "brewCask": 0,
      "choco": 0,
      "dpkg": 0,
      "emerge": 0,
      "eopkg": 0,
      "flatpakSystem": 0,
      "flatpakUser": 0,
      "nixDefault": 0,
      "nixSystem": 0,
      "nixUser": 0,
      "pacman": 824,
      "paludis": 0,
      "pkg": 0,
      "pkgtool": 0,
      "port": 0,
      "rpm": 0,
      "scoop": 0,
      "snap": 0,
      "winget": 0,
      "xbps": 0,
      "opkg": 0,
      "pacmanBranch": ""
    }
  },
  {
    "type": "Shell",
    "result": {
      "exe": "/bin/bash",
      "exeName": "bash",
      "pid": 60277,
      "processName": "bash",
      "version": "5.2.21"
    }
  },
  {
    "type": "Display",
    "result": [
      {
        "width": 2560,
        "height": 1440,
        "id": 0,
        "name": "BNQ78F5",
        "primary": false,
        "refreshRate": 59.9505501052548,
        "rotation": 0,
        "scaledHeight": 1440,
        "scaledWidth": 2560,
        "type": "Unknown"
      }
    ]
  },
  {
    "type": "DE",
    "error": "No DE found"
  },
  {
    "type": "WM",
    "result": {
      "processName": "i3",
      "prettyName": "i3",
      "protocolName": "X11",
      "pluginName": ""
    }
  },
  {
    "type": "WMTheme",
    "error": "Unknown WM: i3"
  },
  {
    "type": "Theme",
    "result": "Adwaita [GTK3/4]"
  },
  {
    "type": "Icons",
    "result": "Papirus-Light [GTK3/4]"
  },
  {
    "type": "Font",
    "result": {
      "display": "Open Sans (12pt) [GTK3/4]",
      "fonts": [
        "",
        "",
        "Open Sans (12pt)",
        "Open Sans (12pt)"
      ]
    }
  },
  {
    "type": "Cursor",
    "result": {
      "theme": "Bibata-Modern-Classic",
      "size": ""
    }
  },
  {
    "type": "Terminal",
    "result": {
      "processName": "kitty",
      "exe": "kitty",
      "exeName": "kitty",
      "pid": 60263,
      "prettyName": "kitty",
      "version": "0.31.0"
    }
  },
  {
    "type": "TerminalFont",
    "result": {
      "font": {
        "name": "JetBrainsMonoNF-Regular",
        "size": "14",
        "styles": [],
        "pretty": "JetBrainsMonoNF-Regular (14pt)"
      },
      "fallback": {
        "name": "",
        "size": "",
        "styles": [],
        "pretty": ""
      }
    }
  },
  {
    "type": "CPU",
    "result": {
      "cpu": "11th Gen Intel(R) Core(TM) i7-1165G7",
      "vendor": "GenuineIntel",
      "cores": {
        "physical": 4,
        "logical": 8,
        "online": 8
      },
      "frequency": {
        "min": 0.4,
        "max": 4.7
      },
      "temperature": null
    }
  },
  {
    "type": "GPU",
    "result": [
      {
        "coreCount": null,
        "memory": {
          "dedicated": {
            "total": null,
            "used": null
          },
          "shared": {
            "total": null,
            "used": null
          }
        },
        "driver": "i915",
        "name": "Iris Xe Graphics",
        "temperature": null,
        "type": "Unknown",
        "vendor": "Intel"
      }
    ]
  },
  {
    "type": "Memory",
    "result": {
      "total": 16551911424,
      "used": 4354154496
    }
  },
  {
    "type": "Swap",
    "result": {
      "total": 4294963200,
      "used": 0
    }
  },
  {
    "type": "Disk",
    "result": [
      {
        "bytes": {
          "available": 447285997568,
          "free": 449736421376,
          "total": 511555141632,
          "used": 61818720256
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "btrfs",
        "mountpoint": "/",
        "mountFrom": "/dev/mapper/root",
        "name": "",
        "volumeType": [
          "Regular"
        ]
      },
      {
        "bytes": {
          "available": 447285997568,
          "free": 449736421376,
          "total": 511555141632,
          "used": 61818720256
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "btrfs",
        "mountpoint": "/.snapshots",
        "mountFrom": "/dev/mapper/root",
        "name": "",
        "volumeType": [
          "Subvolume"
        ]
      },
      {
        "bytes": {
          "available": 459071488,
          "free": 459071488,
          "total": 535805952,
          "used": 76734464
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "vfat",
        "mountpoint": "/boot",
        "mountFrom": "/dev/nvme0n1p1",
        "name": "",
        "volumeType": [
          "Hidden"
        ]
      },
      {
        "bytes": {
          "available": 447285997568,
          "free": 449736421376,
          "total": 511555141632,
          "used": 61818720256
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "btrfs",
        "mountpoint": "/home",
        "mountFrom": "/dev/mapper/root",
        "name": "",
        "volumeType": [
          "Subvolume"
        ]
      },
      {
        "bytes": {
          "available": 447285997568,
          "free": 449736421376,
          "total": 511555141632,
          "used": 61818720256
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "btrfs",
        "mountpoint": "/var/cache/pacman/pkg",
        "mountFrom": "/dev/mapper/root",
        "name": "",
        "volumeType": [
          "Subvolume"
        ]
      },
      {
        "bytes": {
          "available": 447285997568,
          "free": 449736421376,
          "total": 511555141632,
          "used": 61818720256
        },
        "files": {
          "total": 0,
          "used": 0
        },
        "filesystem": "btrfs",
        "mountpoint": "/var/log",
        "mountFrom": "/dev/mapper/root",
        "name": "",
        "volumeType": [
          "Subvolume"
        ]
      }
    ]
  },
  {
    "type": "LocalIp",
    "result": [
      {
        "defaultRoute": true,
        "ipv4": "192.168.0.13/24",
        "ipv6": "",
        "mac": "",
        "name": "wlan0"
      }
    ]
  },
  {
    "type": "Battery",
    "result": [
      {
        "capacity": 96.0,
        "manufacturer": "Celxpert",
        "modelName": "L19C4PF1",
        "status": "Charging",
        "technology": "Li-poly",
        "temperature": null,
        "cycleCount": 724
      }
    ]
  },
  {
    "type": "PowerAdapter",
    "error": "Not supported on this platform"
  },
  {
    "type": "Locale",
    "result": "en_US.UTF-8"
  },
  {
    "type": "Break",
    "error": "Unsupported for JSON format"
  },
  {
    "type": "Colors",
    "error": "Unsupported for JSON format"
  }
]
flipflop133 commented 10 months ago
image

I tried this command:

fastfetch -s Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Terminal:CPU:GPU:Memory:Break:Colors --stat

and then without Display:

fastfetch -s Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:DE:WM:WMTheme:Theme:Icons:Terminal:CPU:GPU:Memory:Break:Colors --stat

And as you can notice on the screenshot, the stat tool seems broken too, as the +-500ms delay was one time reported for the Display and another time for the DE.

CarterLi commented 10 months ago

It's expected. It's displayserver that costs the time, which is used both for display module and lm / de module

flipflop133 commented 10 months ago

I ran this command using last build:

fastfetch -s Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Terminal:CPU:GPU:Memory:Break:Colors --stat

and it's still slow using two monitors as you can see on the screenshot below, if you think it's just how it should be and it's xrandr fault, then you can just close this issue I guess.

image
CarterLi commented 10 months ago

Can you try the dev build with --ds-force-drm?

flipflop133 commented 10 months ago

So I tried the following command with two monitor and with the laptop monitor disabled:

fastfetch -s Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Terminal:CPU:GPU:Memory:Break:Colors --stat --ds-force-drm
image

Without --ds-force-drm, it's still slow but using --ds-force-drm doesn't show WM, theme and icons.

CarterLi commented 10 months ago

I'm able to reproduce this issue. Seems that it only happens when an external display is connected and the builtin display is disabled.

It's really strange. I will investigate it more tomorrow.

CarterLi commented 10 months ago

On my slow linux machine, Display costs about 1257ms. xcb_randr_get_screen_info_reply costs 592ms and xcb_randr_get_screen_resources_reply costs 608ms.

Thanks god KDE is deprecating X11!

flipflop133 commented 10 months ago

Even though xcb should be in theory more modern and faster, maybe using the older style is more efficient in this case.

CarterLi commented 10 months ago

Should be fixed in the latest dev build. Please test.

flipflop133 commented 10 months ago

I can confirm it's now fixed, good job!

image