IPython lite #2282

Closed
dimaqq opened this Issue Aug 10, 2012 · 11 comments

Projects

None yet

4 participants

@dimaqq

I'm a very happy ipython user on my desktop (135135 pystones/second).
I'm glad I can use ipython on an ebedded system, which has a CPU comparable to weakest android phone (902 pystones/second).

Python in general is rather sluggish on this system and ipython gets really slow, here's a comparison:

  • startup: desktop under 1s, embedded 14s
  • 1/0 exception printout: desktop instant, embedded 3s
  • range(1000) printout: desktop under half second, embedded 4s

Is there a chance to lighten up ipython, disable some modules via config or in the ipython code? Is there perhaps an ipython-lite branch?

@Carreau
IPython member

there is a --quick flag, but i think it only skip the config files.
you can try to make a profile that has a lot of --no-xxx options enabled and some others.
see ipython --help-all for the availlables flags.

@takluyver
IPython member

Which version are you using? 0.13 had a bug where it tried to load a lot of libraries (numpy, paramiko, etc.) on startup. But that should only slow it down if you have those libraries installed.

@dimaqq

0.12, not fancy libraries installed. I'll try to make a custom config, let's see if that helps any.

@dimaqq

len([k for k in sys.modules.keys() if "ipy" in k.lower()])
gives me 259 on embedded 0.12 and 388 on desktop 0.13.
are there any modules I can delete without major breakage?

@dimaqq

@Carreau tried the following:
time ipython2 --quick --no-pdb --no-term-title --nosep --no-deep-reload --no-automagic --no-autoindent --no-color-info --no-autoedit-syntax --no-confirm-exit --no-pprint --no-banner -c "import time" # vs
time ipython2 -c "import time"
The difference was negligible.
Let me know if this was not what you meant.

@takluyver
IPython member
@dimaqq

python loads 40 modules on startup, ipython 461 (ipython and its dependencies)
not all modules actually load, some are None.
there 100 ipy* modules that are real: https://gist.github.com/3314160
and here's full list: https://gist.github.com/3314139

@takluyver
IPython member
@dimaqq

100 real ipython modules
259 ipython modules including None's (that is 159 entries "IPxxxx": None in sys.modules)
461 total modules (that is 208 dependencies that are not IPyxxxxx)

None's may also be important if python has to search sys.path for these.

@takluyver
IPython member
@takluyver
IPython member

I don't think there's anything else we're immediately going to do on this, so I'm closing the issue. I did manage to eliminate unittest from the imports at startup. We'll try to keep an eye on it, but any improvements are likely to be incremental, not dramatic changes.

@takluyver takluyver closed this Oct 16, 2014
@minrk minrk modified the milestone: no action, wishlist Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment