Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <quinticent@localhost.localdomain>2007-08-17 21:57:05 (GMT)
committer John (J5) Palmieri <quinticent@localhost.localdomain>2007-08-17 21:57:05 (GMT)
commit735b0cf2c8a5c85b89a0b82d4fc1f40ec6ab5d12 (patch)
tree3807c6a71af135d780ec5265f7c7d65227b05b27 /sugar
parent5ebc0c8212f762025cf6f42fad040cd04cb58ebd (diff)
use numpy to shave 4 seconds off of sugar startup
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/spreadlayout.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sugar/graphics/spreadlayout.py b/sugar/graphics/spreadlayout.py
index 931dc19..7bd1ff1 100644
--- a/sugar/graphics/spreadlayout.py
+++ b/sugar/graphics/spreadlayout.py
@@ -15,7 +15,7 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-from array import array
+from numpy import array
from random import random
import hippo
@@ -41,9 +41,8 @@ class _Grid(gobject.GObject):
self._collisions = []
self._collisions_sid = 0
- self._array = array('B')
- for i in range(width * height):
- self._array.append(0)
+ self._array = array([0], dtype='b')
+ self._array.resize(width * height)
def add(self, child, width, height):
trials = _PLACE_TRIALS