Ticket #756 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

shell consumes lots of cpu on XO

Reported by: tomeu Owned by: erikos
Priority: High Milestone: 0.86
Component: sugar Version: Git as of bugdate
Severity: Major Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

I caught it opening and closing ~/.sugar/default/nm/connections.cfg in a loop

Change History

follow-up: ↓ 2   Changed 4 years ago by tomeu

This will make it stop updating the connections file every few seconds:

diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index 6d2f400..39c71e8 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -215,9 +215,10 @@ class NMSettingsConnection(dbus.service.Object):
         self._secrets = secrets
 
     def set_connected(self):
-        self._settings.connection.autoconnect = True
-        self._settings.connection.timestamp = int(time.time())
-        self.save()
+        if not self._settings.connection.autoconnect:
+            self._settings.connection.autoconnect = True
+            self._settings.connection.timestamp = int(time.time())
+            self.save()
 
     def set_secrets(self, secrets):
         self._secrets = secrets

But it's still doing too much work. I guess it's updating widgets even when nothing changed.

in reply to: ↑ 1   Changed 4 years ago by tomeu

  • owner changed from tomeu to erikos
  • status changed from new to assigned
  • severity changed from Major to Blocker

Replying to tomeu:


But it's still doing too much work. I guess it's updating widgets even when nothing changed.

Confirmed, we should apply the patch above for 0.84 and make sure for 0.86 that nothing expensive is done when nothing changes. One idea is to wrap all instance variables that influence the UI in methods such as:

    def _set_X(self, new_X):
        if self._X == new_X:
            return
        self._X = new_X
        [update UI]

  Changed 4 years ago by tomeu

  • severity changed from Blocker to Major
  • milestone changed from 0.84 to 0.86

  Changed 3 years ago by bernie

  • status changed from assigned to closed
  • resolution set to fixed

So this bug shoould be closed.

Note: See TracTickets for help on using tickets.