[Sugar-devel] Performance: activities start up time

Daniel Narvaez dwnarvaez at gmail.com
Sat Nov 9 04:37:35 EST 2013


Right, as you can see it only loads gobject introspection stuff. If you do
the import after any other gi import it shouldn't even do that, because
those modules will have been loaded already. It should basically not touch
the disk at all... Which is why it's totally weird that moving the import
helps startup time.

Did you try to repeat your timings dropping kernel memory cache every time?
(unless they was taken that way already). Otherwise they are not going to
be very accurate.

Did you try to measure the time it takes to do the import? Something simple
like this in the unpatched activity code should be enough

import logging
start = time.time()
--- here are the two imports ---
logging.error(time.time() - start)

On Saturday, 9 November 2013, Gonzalo Odiard wrote:

> In my system, using
>
>  strace -e trace=open,close,read,write,connect,accept -p pid
>
> in another terminal, when I do:
>
> from gi.repository import EvinceDocument
>
> I see:
>
> open("gi.so", O_RDONLY)                 = -1 ENOENT (No such file or
> directory)
> open("gimodule.so", O_RDONLY)           = -1 ENOENT (No such file or
> directory)
> open("gi.py", O_RDONLY)                 = -1 ENOENT (No such file or
> directory)
> open("gi.pyc", O_RDONLY)                = -1 ENOENT (No such file or
> directory)
> open("/usr/bin/gi.so", O_RDONLY)        = -1 ENOENT (No such file or
> directory)
> open("/usr/bin/gimodule.so", O_RDONLY)  = -1 ENOENT (No such file or
> directory)
> open("/usr/bin/gi.py", O_RDONLY)        = -1 ENOENT (No such file or
> directory)
> open("/usr/bin/gi.pyc", O_RDONLY)       = -1 ENOENT (No such file or
> directory)
> open("/usr/lib64/python2.7/gi.so", O_RDONLY) = -1 ENOENT (No such file
> or directory)
> open("/usr/lib64/python2.7/gimodule.so", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/lib64/python2.7/gi.py", O_RDONLY) = -1 ENOENT (No such file
> or directory)
> open("/usr/lib64/python2.7/gi.pyc", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> open("/usr/lib64/python2.7/plat-linux2/gi.so", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/plat-linux2/gimodule.so", O_RDONLY) = -1
> ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/plat-linux2/gi.py", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/plat-linux2/gi.pyc", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/lib-tk/gi.so", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/lib64/python2.7/lib-tk/gimodule.so", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/lib-tk/gi.py", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/lib64/python2.7/lib-tk/gi.pyc", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/lib64/python2.7/lib-dynload/gi.so", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/lib-dynload/gimodule.so", O_RDONLY) = -1
> ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/lib-dynload/gi.py", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/lib-dynload/gi.pyc", O_RDONLY) = -1 ENOENT
> (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/__init__.so", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/__init__module.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/__init__.py", O_RDONLY) = 5
> open("/usr/lib64/python2.7/site-packages/gi/__init__.pyc", O_RDONLY) = 6
> read(6, "\3\363\r\nn;\324Pc\0\0\0\0\0\0\0\0\3\0\0\0@
> @\0\0s\311\0\0\0d\0"...,
> 4096) = 2118
> read(6, "", 4096)                       = 0
> close(6)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gi.so", O_RDONLY) = 7
> open("/usr/lib64/python2.7/site-packages/gi/_gi.so", O_RDONLY|O_CLOEXEC) =
> 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\216\0\0\0\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 8
> close(8)                                = 0
> open("/lib64/libgirepository-1.0.so.1", O_RDONLY|O_CLOEXEC) = 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\177\0\2167\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libgobject-2.0.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\253\340j7\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\240\341i7\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libpyglib-gi-2.0-python.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\32\0\0\0\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libgmodule-2.0.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\21
> k7\0\0\0"..., 832) = 832
> close(8)                                = 0
> open("/lib64/librt.so.1", O_RDONLY|O_CLOEXEC) = 8
> read(8, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\"`h7\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libgio-2.0.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\1ck7\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/lib64/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 8
> read(8,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\6\240j7\0\0\0"...,
> 832) = 832
> close(8)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/__init__.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/__init__module.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/__init__.py",
> O_RDONLY) = 8
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/__init__.pyc",
> O_RDONLY) = 9
> read(9, "\3\363\r\nn;\324Pc\0\0\0\0\0\0\0\0\3\0\0\0@
> \0\0\0s\364\6\0\0d\0"...,
> 4096) = 4096
> read(9,
> "\1\22\2\6\1\34\1\17\1\f\1\t\1\t\1\20\1\24\2\6\1\4\2\t\2\36\1\r\1$\1\3"...,
> 4096) = 4096
> read(9,
> "\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t\1\t"...,
> 4096) = 177
> read(9, "", 4096)                       = 0
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/sys.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/sysmodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/sys.py",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/sys.pyc",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/__init__.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/__init__module.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/__init__.py", O_RDONLY)
> = 9
> open("/usr/lib64/python2.7/site-packages/gi/_glib/__init__.pyc", O_RDONLY)
> = 10
> read(10, "\3\363\r\nm;\324Pc\0\0\0\0\0\0\0\0\2\0\0\0@
> \0\0\0sG\3\0\0d\0"...,
> 4096) = 3103
> read(10, "", 4096)                      = 0
> close(10)                               = 0
> open("/usr/lib64/python2.7/site-packages/gi/_glib/_glib.so", O_RDONLY) = 10
> open("/usr/lib64/python2.7/site-packages/gi/_glib/_glib.so",
> O_RDONLY|O_CLOEXEC) = 11
> read(11,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260f\0\0\0\0\0\0"...,
> 832) = 832
> close(11)                               = 0
> close(10)                               = 0
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/_gobject.so",
> O_RDONLY) = 9
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/_gobject.so",
> O_RDONLY|O_CLOEXEC) = 10
> read(10,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\223\0\0\0\0\0\0"...,
> 832) = 832
> close(10)                               = 0
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/constants.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/constantsmodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/constants.py",
> O_RDONLY) = 9
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/constants.pyc",
> O_RDONLY) = 10
> read(10, "\3\363\r\nn;\324Pc\0\0\0\0\0\0\0\0\2\0\0\0@
> \0\0\0s\207\2\0\0d\0"...,
> 4096) = 2041
> read(10, "", 4096)                      = 0
> close(10)                               = 0
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/propertyhelper.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
>
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/propertyhelpermodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/propertyhelper.py",
> O_RDONLY) = 9
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/propertyhelper.pyc",
> O_RDONLY) = 10
> read(10, "\3\363\r\nn;\324Pc\0\0\0\0\0\0\0\0\3\0\0\0@
> \0\0\0s.\1\0\0d\0"...,
> 4096) = 4096
> read(10, "\0\0_type_from_pythont\4\0\0\0typet\f\0\0"..., 4096) = 4096
> read(10, "ges/gi/_gobject/propertyhelper.p"..., 4096) = 3001
> read(10, "", 4096)                      = 0
> close(10)                               = 0
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/signalhelper.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
>
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/signalhelpermodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/signalhelper.py",
> O_RDONLY) = 9
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/signalhelper.pyc",
> O_RDONLY) = 10
> read(10, "\3\363\r\nn;\324Pc\0\0\0\0\0\0\0\0\4\0\0\0@
> \0\0\0s\225\0\0\0d\0"...,
> 4096) = 4096
> read(10, "\0\0\6\0\0\0C\0\0\0s\316\0\0\0|\2\0r\31\0|\1\0\fr\31\0|\2\0j"...,
> 4096) = 4096
> read(10, "\0\0(\3\0\0\0R\22\0\0\0R$\0\0\0R#\0\0\0(\0\0\0\0(\1\0\0\0"...,
> 4096) = 1273
> read(10, "", 4096)                      = 0
> close(10)                               = 0
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/inspect.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/inspectmodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/inspect.py",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_gobject/inspect.pyc",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> close(9)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/_glib/option.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/optionmodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/option.py", O_RDONLY) = 9
> open("/usr/lib64/python2.7/site-packages/gi/_glib/option.pyc", O_RDONLY) =
> 10
> read(10, "\3\363\r\nm;\324Pc\0\0\0\0\0\0\0\0\t\0\0\0@
> \0\0\0s\6\1\0\0d\0"...,
> 4096) = 4096
> read(10,
> "\0Z\4\0d\3\0\204\0\0Z\5\0d\4\0\204\0\0Z\6\0d\7\0d\5\0\204\1\0Z"...,
> 8192) = 8192
> read(10, "\0\0\0Ro\0\0\0R|\0\0\0R}\0\0\0R\177\0\0\0R\204\0\0\0R8\0\0"...,
> 4096) = 460
> read(10, "", 4096)                      = 0
> close(10)                               = 0
> open("/usr/lib64/python2.7/site-packages/gi/_glib/sys.so", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/sysmodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/sys.py", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/sys.pyc", O_RDONLY)
> = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/optparse.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/optparsemodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/optparse.py",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/optparse.pyc",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/gi.so", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/gimodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/gi.py", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/_glib/gi.pyc", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> close(9)                                = 0
> close(8)                                = 0
> close(7)                                = 0
> close(5)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/repository/__init__.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/repository/__init__module.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/repository/__init__.py",
> O_RDONLY) = 5
> open("/usr/lib64/python2.7/site-packages/gi/repository/__init__.pyc",
> O_RDONLY) = 7
> read(7, "\3\363\r\nl;\324Pc\0\0\0\0\0\0\0\0\3\0\0\0@@\0\0sL\0\0\0d\0"...,
> 4096) = 378
> read(7, "", 4096)                       = 0
> close(7)                                = 0
> open("/usr/lib64/python2.7/site-packages/gi/importer.so", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/importermodule.so",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/lib64/python2.7/site-packages/gi/importer.py", O_RDONLY) = 7
> open("/usr/lib64/python2.7/site-packages/gi/importer.pyc", O_RDONLY) = 8
> read(8, "\3\363\r\nn;\324P
> Gonzalo
>
> On Sat, Nov 9, 2013 at 1:52 AM, Gonzalo Odiard <gonzalo at laptop.org<javascript:;>>
> wrote:
> > Can you explain me how you verified the library was not loaded?
> >
> > Gonzalo
> >
> >
> > On Fri, Nov 8, 2013 at 8:16 PM, Daniel Narvaez <dwnarvaez at gmail.com<javascript:;>>
> wrote:
> >>
> >> It's not just theory, I verified importing evince doesn't even cause the
> >> library to be loaded. I don't have a XO 1 to check what is going on
> myself,
> >> unfortunately.
> >>
> >> My suggestion is to *not* checkin this kind of workaround without any
> clue
> >> about why the change helps, and especially to *not* suggest people
> should do
> >> the same kind of change in other activities.
> >>
> >> That said, I don't maintain any of the activities so feel free to go
> ahead
> >> if you think it's a sensible approach (sigh).
> >
> >
>


-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131109/97ad03fa/attachment-0001.html>


More information about the Sugar-devel mailing list