Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does running IPython/Jupyter Notebook affect the speed of the program?

I am developing a program for simulation (kind of like numerical solver). I am developing it in an ipython notebook. I am wondering if the speed of the code running in the notebook is the same as the speed of the code running from terminal ?

Would browser memory or overhead from notebook and stuff like that makes code run slower in notebook compared to native run from the terminal?

like image 696
aha Avatar asked Feb 08 '15 01:02

aha


People also ask

What is the disadvantage of Jupyter Notebook?

Disadvantages of Jupyter NotebookIt is very hard to test long asynchronous tasks. Less Security. It runs cell out of order. In Jupyter notebook, there is no IDE integration, no linting, and no code-style correction.

Why does Jupyter Notebook slow down?

Probably your memory use gets quite high, and then the jupyter notebook slows down, as it goes on your hard disk then. The risk is also that it can crash soon. Try to get clean all the data you do not need anymore. If you do not need a dataset after the merge, delete it.

How much RAM does Jupyter Notebook use?

Memory and disk space required per user: 512MB RAM + 1GB of disk + . 5 CPU core. Server overhead: 2-4GB or 10% system overhead (whatever is larger), . 5 CPU cores, 10GB disk space.


2 Answers

One of the things that might slow things a lot would be if you had a lot of print statements in your simulation.

If you run the kernels server and browser on the same machine, assuming your simulation would have used all the cores of your computer, yes using notebook will slow things down. But no more than browsing facebook or Youtube while the simulation is running. Most of the overhead of using IPython is actually when you press shift-enter. In pure python prompt the REPL might react in 100ms, and in IPython 150 or alike. But if you are concern about performance, the overhead of IPython is not the first thing you should be concern about.

like image 60
Matt Avatar answered Sep 28 '22 05:09

Matt


I tested learning the same small neural net (1) under Jupyter and (2) running Python under Anaconda prompt (either with exec(open(foo.py).read()) under python or with python foo.py directly under Anaconda prompt).

It takes 107.4 sec or 108.2 sec under Anaconda prompt, and 105.7 sec under Jupyter.

So no, there is no significant difference, and the minor difference is in favor of Jupyter.

like image 23
user31264 Avatar answered Sep 28 '22 05:09

user31264