Opened 12 years ago

Closed 11 years ago

Last modified 7 years ago

#756 closed defect (fixed)

shell consumes lots of cpu on XO

Reported by: tomeu Owned by: erikos
Priority: High Milestone:
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 (5)

comment:1 follow-up: Changed 12 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.

comment:2 in reply to: ↑ 1 Changed 12 years ago by tomeu

  • Owner changed from tomeu to erikos
  • Severity changed from Major to Blocker
  • Status changed from new to assigned

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]

comment:3 Changed 12 years ago by tomeu

  • Milestone changed from 0.84 to 0.86
  • Severity changed from Blocker to Major

comment:4 Changed 11 years ago by bernie

  • Resolution set to fixed
  • Status changed from assigned to closed

So this bug shoould be closed.

comment:5 Changed 7 years ago by dnarvaez

  • Milestone 0.86 deleted

Milestone 0.86 deleted

Note: See TracTickets for help on using tickets.