Desktop Icons NG gjs high CPU usage when moving/resizing any window

Bug #1965537 reported by openwebdesign
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gnome Shell Extension Desktop Icons Ng
New
Unknown
gnome-shell-extension-desktop-icons-ng (Ubuntu)
Fix Released
Medium
Sergio Costas

Bug Description

Desktop Icons NG gjs high CPU usage when moving window - check enclosed video. When I disable Desktop Icons NG extensions CPU usage is fine.

System spec:
Intel® Core™ i7-2600 CPU @ 3.40GHz × 8
AMD® Radeon rx 560 series
Wayland
Ubuntu 22.04

Revision history for this message
openwebdesign (info-openwebdesign) wrote :
description: updated
tags: added: jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed on Intel graphics too.

tags: added: performance
tags: added: wayland wayland-session
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
importance: Undecided → Medium
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

I can't reproduce this, neither in Debian SID, nor in an Ubuntu 22.04 in a virtual machine.

Are you using the desktop icons NG extension that is bundled with Ubuntu, or did you uninstall it and installed the last version from the git repository?

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Here is a freshly installed Ubuntu 22.04 inside a VirtualBox machine.

What other extensions do you have installed?

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

I'll try to install ubuntu 22.04 in an old laptop with intel graphics and test it again... give me an hour.

Revision history for this message
openwebdesign (info-openwebdesign) wrote :

- Desktop Icons NG bundled with Ubuntu.
- I have disabled all extensions except NG icons and the problem persists.

Revision history for this message
openwebdesign (info-openwebdesign) wrote :

Installed extensions:
'<email address hidden>', '<email address hidden>', '<email address hidden>', 'just-perfection-desktop@just-perfection', '<email address hidden>', '<email address hidden>', '<email address hidden>'

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Thanks. I installed Ubuntu 22.04 in my laptop and I wasn't unable to reproduce this... until I found that, yes, when moving a window, the CPU usage in DING goes up. Not up to 100%, but up to 20%. Oddly enough, in my Debian PC it works fine and the CPU doesn't go up, but at least now I can reproduce it somehow.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Ok, I have delimited the problem: in Ubuntu, when a window is moved, the desktop manager emits the size-changed signal (which should be emitted only when the desktop size has changed).

This is really odd.

I'll do some extra tests.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also assigned to gnome-shell/mutter since it sounds like the problem is originating there (comment #10).

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
importance: Undecided → Medium
Changed in mutter (Ubuntu):
importance: Undecided → Medium
Changed in gnome-shell (Ubuntu):
status: Confirmed → Triaged
Changed in mutter (Ubuntu):
status: Confirmed → Triaged
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: Triaged → Fix Committed
tags: added: fixed-in-40 fixed-upstream
no longer affects: gnome-shell (Ubuntu)
no longer affects: mutter (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Dropped the gnome-shell/mutter tasks because it seems like most of the fault lies in DING.

https://gitlab.com/rastersoft/desktop-icons-ng/-/issues/219#note_885000330

summary: - Desktop Icons NG gjs high CPU ussage when moving window
+ Desktop Icons NG gjs high CPU usage when moving/resizing any window
tags: added: rls-jj-incoming
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: Fix Committed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually we can optimize DING further...

tags: removed: fixed-in-40 fixed-upstream
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
assignee: nobody → Sergio Costas (rastersoft-gmail)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-shell-extension-desktop-icons-ng - 43-1

---------------
gnome-shell-extension-desktop-icons-ng (43-1) unstable; urgency=medium

  * New upstream release

 -- Gunnar Hjalmarsson <email address hidden> Wed, 23 Mar 2022 15:03:28 +0100

Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The final fix in comment #15 hasn't landed yet, but the changes in version 43-1 might be enough for this bug.

Not sure if we would reopen this bug or create a new one... I haven't yet measured the performance difference that the remaining fix would make.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Let's consider it partially fixed and reopen it.

Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
openwebdesign (info-openwebdesign) wrote :

Thank you!

tags: added: dt-304
tags: added: fixed-in-44 fixed-upstream
Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-shell-extension-desktop-icons-ng - 43-2

---------------
gnome-shell-extension-desktop-icons-ng (43-2) unstable; urgency=medium

  * Cherry-pick translation updates & a fix for high CPU
    when moving or resizing a window (LP: #1965537)

 -- Jeremy Bicha <email address hidden> Tue, 12 Apr 2022 14:23:17 -0400

Changed in gnome-shell-extension-desktop-icons-ng (Ubuntu):
status: Fix Committed → Fix Released
Changed in gnome-shell-extension-desktop-icons-ng:
status: Unknown → New
Revision history for this message
donpdonp (don-park) wrote :

I'm on Ubuntu 22.04 and this package is pegging my CPU at 100%

ii gnome-shell-extension-desktop-icons-ng 43-2ubuntu1 all desktop icon support for GNOME Shell

   PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 157956 donp 20 0 3723044 263804 52196 R 109.3 3.3 0:54.62 gjs

 157956 ? Rl 1:14 gjs /<email address hidden>/ding.js -E -P /<email address hidden> -M 0 -D 0:0:1920:1080:1:27:0:74:0:0

if i kill -9, gnome launches another copy.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If the gjs process is using high CPU then please attach gdb to it and run:

  call gjs_backtrace()

After a few attempts it should give a stack trace that will help us debug the problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.