#5228 HIGH Update.: launching activities is slow
Zarro Boogs per Child
bugtracker at laptop.org
Fri Dec 14 13:05:26 EST 2007
#5228: launching activities is slow
---------------------+------------------------------------------------------
Reporter: tomeu | Owner: tomeu
Type: defect | Status: new
Priority: high | Milestone: Update.1
Component: sugar | Version:
Resolution: | Keywords: performance
Verified: 0 |
---------------------+------------------------------------------------------
Comment(by tomeu):
This patch to python will make it print the time that each import takes.
{{{
--- ../Python.orig/Python-2.5.1/Python/import.c 2007-03-14
00:04:29.000000000 +0100
+++ Python/import.c 2007-12-14 18:56:47.000000000 +0100
@@ -666,11 +666,21 @@
PyErr_Clear(); /* Not important enough to report */
Py_DECREF(v);
+ time_t t0, t1; /* time_t is defined on <bits/types.h> as long */
+ clock_t c0, c1; /* clock_t is defined on <bits/types.h> as long */
+
+ t0 = time(NULL);
+ c0 = clock();
+
v = PyEval_EvalCode((PyCodeObject *)co, d, d);
if (v == NULL)
goto error;
Py_DECREF(v);
+ t1 = time(NULL);
+ c1 = clock();
+ printf ("\timported %s cpu: %f real: %ld\n", pathname, (float) (c1 -
c0)/CLOCKS_PER_SEC, (long) (t1 - t0));
+
if ((m = PyDict_GetItemString(modules, name)) == NULL) {
PyErr_Format(PyExc_ImportError,
"Loaded module %.200s not found in
sys.modules",
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/5228#comment:17>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list