First of all I hope you have a nice holiday season and I like to wish
you all the best for 2012.
I am doing a little bit of profiling for the start up time of a little
demo app I did with Mike D. and noted that the "import
pubsub.setupkwargs" is very slow.
Here the import I do:
import logging
log = logging.getLogger(__package__)
log.debug("start pub")
try:
import pubsub.setupkwargs
log.debug("setup kwargs")
from pubsub import pub
log.debug("import pub")
except ImportError:
import wx.lib.pubsub.setupkwargs
from wx.lib.pubsub import pub
log.debug("pub imported")
And this is the log I get:
2011-12-28 10:22:25,414 - mlsrc.controllers - DEBUG - base.py - 9 - wx
imported
2011-12-28 10:22:26,618 - mlsrc.controllers - DEBUG - base.py - 12 -
models imported
2011-12-28 10:22:26,648 - mlsrc - DEBUG - mypub.py - 30 - start pub
2011-12-28 10:22:29,273 - mlsrc - DEBUG - mypub.py - 33 - setup kwargs
2011-12-28 10:22:29,321 - mlsrc - DEBUG - mypub.py - 35 - import pub
2011-12-28 10:22:29,321 - mlsrc - DEBUG - mypub.py - 39 - pub imported
2011-12-28 10:22:29,351 - mlsrc - DEBUG - mypub.py - 42 - topics imported
2011-12-28 10:22:29,351 - mlsrc - DEBUG - mypub.py - 45 - topic setup
As you can see it takes about 2.5 seconds. Is there anything one can do
about this?
Werner
Cleaning it up resolved this, but I am a bit surprised as I always
thought it was the first one in the path would get imported, i.e. it
wouldn't search any further, which means I can't really explain why it
was slow to start with.
Werner
On 12/28/2011 10:27 AM, werner wrote:
Hi Oliver,
First of all I hope you have a nice holiday season and I like to wish you all the best for 2012.
I am doing a little bit of profiling for the start up time of a little demo app I did with Mike D. and noted that the "import pubsub.setupkwargs" is very slow.
...
As you can see it takes about 2.5 seconds. Is there anything one can do about this?
Did a bit more digging, it seems to be the import of "pubsub.setupkwargs" and checking how the Python path was setup at that point I noticed that I had two entries which potentially would resolve.
Cleaning it up resolved this, but I am a bit surprised as I always thought it was the first one in the path would get imported, i.e. it wouldn't search any further, which means I can't really explain why it was slow to start with.
On Wed, Dec 28, 2011 at 6:04 AM, werner <wbr...@free.fr> wrote:
Did a bit more digging, it seems to be the import of "pubsub.setupkwargs" and checking how the Python path was setup at that point I noticed that I had two entries which potentially would resolve.On 12/28/2011 10:27 AM, werner wrote:
Hi Oliver,
First of all I hope you have a nice holiday season and I like to wish you all the best for 2012.
I am doing a little bit of profiling for the start up time of a little demo app I did with Mike D. and noted that the "import pubsub.setupkwargs" is very slow.
...
As you can see it takes about 2.5 seconds. Is there anything one can do about this?
Cleaning it up resolved this, but I am a bit surprised as I always thought it was the first one in the path would get imported, i.e. it wouldn't search any further, which means I can't really explain why it was slow to start with.
Hi Werner, same wishes to you! Just curious, what was second path entry pointing to, a different version of pubsub?
I'm similarly puzzled that this would have anything to do with it, but hey, problem solved!
I know that one thing that can make a big difference is if pubsub is installed as an egg in zip format rather than folder format. Make sure you install egg (if that's what you use) as folder by adding the -Z switch to easy_install.