Ipython laptop is 11 times slower than python: why?

I am running a script on an ipython laptop (with Chrome) and noticed that it is 11 times slower than if I were running the same script in Python, using spyder as my IDE. The script is pretty simple: it's just a collection of loops and calculations on a pandas frame. The output does not output or write to external files. I expect the code to be slow because it is not vectorized, I believe that Ipython may include some overhead, but 11 times ...! Can you come up with any reasons? Any suggestions?

Thanks!

+7
ipython ipython-notebook
source share
1 answer

I tested this on my machine and found that ipython is faster.

$ cat ex.py import time import numpy as np now = time.time() #(seconds) a = [] for j in range(2): for s in range(10): a.append(np.random.random()) then = now print(time.time() - then) $ python ex.py 0.142902851105 In [1]: %run ex.py 0.06136202812194824 

I am sure this is the part of Chrome in your ipython installation that causes a slowdown.

+2
source share

All Articles