linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.48k stars 728 forks source link

Notifications menu needs some optimization #12291

Open anaximeno opened 1 month ago

anaximeno commented 1 month ago

Distribution

LMDE 6

Package version

Cinnamon 6.0

Graphics hardware in use

Intel Alder Lake-UP3 GT2 [Iris Xe Graphics]

Frequency

Always

Bug description

If there are some notifications on the notifications menu, it becomes too slow, doesn't even need to be a lot, and uses a lot of CPU resources while it's open.

Steps to reproduce

https://github.com/user-attachments/assets/955f5ca2-f43c-4ae6-bc10-16cfdd426ee5

Expected behavior

It probably shouldn't use this many resources to keep the notification menu open for only these notifications. So maybe some optimizations might be necessary.

Additional information

No response

rcalixte commented 1 month ago

If there are some notifications on the notifications menu, it becomes too slow, doesn't even need to be a lot, and uses a lot of CPU resources while it's open.

I've confirmed that this activity does spike the CPU but I've also noticed it with the Menu applet. This leads me to believe it goes deeper and likely into the toolkit. That means it could take a while to even trace.

JosephMcc commented 1 month ago

I don't really see how this is a bug. So, you are using your computer to do something and it used more cpu? Kind of what you would expect. Also curious how htop is showing Cinnamon using like 94% cpu and obs using 50+ %. Not to mention everything else that is using some. Not sure how htop works. Tested here and cinnamon never uses more than 12% with the notification applet. Uses more when moving around in the start menu, but would sort of expect that since a lot of redrawing is going on.

anaximeno commented 1 month ago

I don't really see how this is a bug. So, you are using your computer to do something and it used more cpu? Kind of what you would expect. Also curious how htop is showing Cinnamon using like 94% cpu and obs using 50+ %. Not to mention everything else that is using some. Not sure how htop works. Tested here and cinnamon never uses more than 12% with the notification applet. Uses more when moving around in the start menu, but would sort of expect that since a lot of redrawing is going on.

What's strange is that after opening the notification menu, the CPU usage continues constantly high. What you would expect is to have some increase in CPU use (probably while constructing the menu for the first time) and then it should reduce the CPU use, I've tested with the start menu and this is the case, and another point is that the start menu does not directly use as many resources as the notification menu is using (while only having 5 notifications). In the video, the notification menu also takes some time to open, more than the start menu takes usually, which is why I noticed this issue.

It seems to me that something needs to be optimized.

About OBS using less CPU I suppose it's because OBS is using multiprocessing, and the Notification menu is executing in that specific Cinnamon process that appeared in the video.

gsarkardev commented 1 month ago

Can confirm. +1

alexkuz commented 1 month ago

@rcalixte it definitely goes deeper and is not always reproducible. I shared one of the scenarios that seems to be always triggering this behaviour here

murrple-1 commented 2 weeks ago

+1. Video in OP comment is similar to what I'm seeing

``` System: Kernel: 6.8.0-40-generic arch: x86_64 bits: 64 compiler: gcc v: 13.2.0 clocksource: tsc Desktop: Cinnamon v: 6.2.9 tk: GTK v: 3.24.41 wm: Muffin v: 6.2.0 vt: 7 dm: LightDM v: 1.30.0 Distro: Linux Mint 22 Wilma base: Ubuntu 24.04 noble Machine: Type: Laptop System: Dell product: XPS 15 9510 v: N/A serial: Chassis: type: 10 serial: Mobo: Dell model: 0WH7HY v: A01 serial: part-nu: 0A61 uuid: UEFI: Dell v: 1.24.0 date: 09/12/2023 Battery: ID-1: BAT0 charge: 78.6 Wh (100.0%) condition: 78.6/84.3 Wh (93.2%) volts: 12.4 min: 11.4 model: BYD DELL M59JH21 type: Li-poly serial: status: full Memory: System RAM: total: 32 GiB available: 31.07 GiB used: 10.49 GiB (33.8%) Message: For most reliable report, use superuser + dmidecode. Array-1: capacity: 64 GiB slots: 2 modules: 2 EC: None max-module-size: 32 GiB note: est. Device-1: DIMM A type: DDR4 detail: synchronous size: 16 GiB speed: 3200 MT/s volts: 1 width (bits): data: 64 total: 64 manufacturer: 80CE000080CE part-no: M471A2G43BB2-CWE serial: Device-2: DIMM B type: DDR4 detail: synchronous size: 16 GiB speed: 3200 MT/s volts: 1 width (bits): data: 64 total: 64 manufacturer: 80CE000080CE part-no: M471A2G43BB2-CWE serial: CPU: Info: 8-core model: 11th Gen Intel Core i7-11800H bits: 64 type: MT MCP smt: enabled arch: Tiger Lake rev: 1 cache: L1: 640 KiB L2: 10 MiB L3: 24 MiB Speed (MHz): avg: 955 high: 1173 min/max: 800/4600 cores: 1: 1080 2: 1069 3: 1075 4: 800 5: 1098 6: 923 7: 800 8: 1100 9: 800 10: 1173 11: 800 12: 800 13: 1014 14: 1151 15: 800 16: 800 bogomips: 73728 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx Graphics: Device-1: Intel TigerLake-H GT1 [UHD Graphics] vendor: Dell driver: i915 v: kernel arch: Gen-12.1 ports: active: eDP-1 empty: DP-1,DP-2,DP-3 bus-ID: 0000:00:02.0 chip-ID: 8086:9a60 class-ID: 0300 Device-2: NVIDIA GA107M [GeForce RTX 3050 Mobile] vendor: Dell driver: nvidia v: 535.183.01 arch: Ampere bus-ID: 0000:01:00.0 chip-ID: 10de:25a2 class-ID: 0302 Device-3: Microdia Integrated_Webcam_HD driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-11:4 chip-ID: 0c45:672e class-ID: 0e02 Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.6 driver: X: loaded: modesetting,nvidia unloaded: fbdev,nouveau,vesa dri: iris gpu: i915 display-ID: :0 screens: 1 Screen-1: 0 s-res: 3456x2160 s-dpi: 98 s-size: 898x561mm (35.35x22.09") s-diag: 1059mm (41.69") Monitor-1: eDP-1 model: Samsung 0x414d res: 3456x2160 hz: 60 dpi: 261 size: 336x210mm (13.23x8.27") diag: 396mm (15.6") modes: 3456x2160 API: EGL Message: No EGL data available. API: OpenGL v: 4.6 vendor: intel mesa v: 24.0.9-0ubuntu0.1 glx-v: 1.4 es-v: 3.2 direct-render: yes renderer: Mesa Intel UHD Graphics (TGL GT1) device-ID: 8086:9a60 Audio: Device-1: Intel Tiger Lake-H HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus-ID: 0000:00:1f.3 chip-ID: 8086:43c8 class-ID: 0403 API: ALSA v: k6.8.0-40-generic status: kernel-api Server-1: PipeWire v: 1.0.5 status: active with: 1: pipewire-pulse status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin Network: Device-1: Intel Tiger Lake PCH CNVi WiFi vendor: Rivet Networks driver: iwlwifi v: kernel bus-ID: 0000:00:14.3 chip-ID: 8086:43f0 class-ID: 0280 IF: wlp0s20f3 state: up mac: IF-ID-1: br-1fdb4f00a57b state: down mac: IF-ID-2: br-e4ff5e370787 state: down mac: IF-ID-3: br-f5332979d459 state: down mac: IF-ID-4: docker0 state: down mac: IF-ID-5: vpn0 state: down mac: N/A Bluetooth: Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 3-14:6 chip-ID: 8087:0026 class-ID: e001 Report: hciconfig ID: hci0 rfk-id: 0 state: up address: bt-v: 5.2 lmp-v: 11 sub-v: 20f9 hci-v: 11 rev: 20f9 class-ID: 7c010c RAID: Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:9a0b rev: class-ID: 0104 Drives: Local Storage: total: 480.68 GiB used: 46.95 GiB (9.8%) ID-1: /dev/nvme0n1 vendor: SK Hynix model: PC711 NVMe 512GB size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 tech: SSD serial: fw-rev: 41001131 temp: 45.9 C scheme: GPT ID-2: /dev/sda model: USB Flash Disk size: 3.74 GiB type: USB rev: 2.0 spd: 480 Mb/s lanes: 1 tech: SSD serial: fw-rev: 1100 scheme: MBR Partition: ID-1: / size: 466.01 GiB used: 43.94 GiB (9.4%) fs: ext4 dev: /dev/dm-0 mapped: vgmint-root ID-2: /boot/efi size: 511 MiB used: 6.1 MiB (1.2%) fs: vfat dev: /dev/nvme0n1p1 ID-3: /media/mchristo/e780fbef-7301-4ef4-96c3-0cfe125b1375 size: 3.6 GiB used: 3 GiB (83.5%) fs: ext4 dev: /dev/sda1 Swap: ID-1: swap-1 type: partition size: 1.91 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/dm-1 mapped: vgmint-swap_1 Sensors: System Temperatures: cpu: 48.0 C mobo: 43.0 C sodimm: SODIMM C Fan Speeds (rpm): cpu: 2373 Repos: Packages: 2173 pm: dpkg pkgs: 2160 pm: flatpak pkgs: 13 No active apt repos in: /etc/apt/sources.list Active apt repos in: /etc/apt/sources.list.d/docker.list 1: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 1: deb https://mirrors.cicku.me/linuxmint/packages wilma main upstream import backport 2: deb https://mirror.it.ubc.ca/ubuntu noble main restricted universe multiverse 3: deb https://mirror.it.ubc.ca/ubuntu noble-updates main restricted universe multiverse 4: deb https://mirror.it.ubc.ca/ubuntu noble-backports main restricted universe multiverse 5: deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse Active apt repos in: /etc/apt/sources.list.d/slack.list 1: deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main Active apt repos in: /etc/apt/sources.list.d/sublime-text.list 1: deb https://download.sublimetext.com/ apt/stable/ Active apt repos in: /etc/apt/sources.list.d/vscode.list 1: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/code stable main Info: Processes: 449 Power: uptime: 1d 8h 26m states: freeze,mem suspend: s2idle wakeups: 1 hibernate: disabled Init: systemd v: 255 target: graphical (5) default: graphical Compilers: gcc: 13.2.0 Shell: Bash v: 5.2.21 running-in: gnome-terminal inxi: 3.3.34 ```