n-riesco / jp-babel

jp-babel is a babel kernel for the Jupyter notebook
Other
86 stars 16 forks source link

jp-babel slow on first eval after kernel start #4

Closed gnl closed 7 years ago

gnl commented 8 years ago

jp-babel seems to take about 10-15 seconds on the first eval with a fresh kernel (even on something simple as 1+2) as opposed to ijavascript's almost immediate evaluation.

Any way to speed this up?

n-riesco commented 8 years ago

I started to notice a slowdown after I upgraded jp-babel to use Babel v6, but not as as slow as 10-15 seconds. I was hoping using babel-node will solve this issue. In the meantime, I would recommend to use jp-babel@0.0.6 that depends on Babel v5:

sudo npm install -g jp-babel@0.0.6

n-riesco commented 7 years ago

@gnl Is this still as bad as 10-15 seconds for you?

I'm using:

$ npm install -g jp-babel
/home/user/bin/jp-babel -> /home/user/lib/node_modules/jp-babel/bin/jp-babel.js
/home/user/lib
└─┬ jp-babel@0.0.9 
  ├─┬ babel-core@6.13.2 
  │ ├── babel-traverse@6.13.0 
  │ ├── babel-types@6.13.0 
  │ ├── lodash@4.14.2 
  │ └── minimatch@3.0.3 
  └─┬ babel-preset-es2015@6.13.2 
    ├── babel-plugin-transform-es2015-modules-amd@6.8.0 
    ├── babel-plugin-transform-es2015-modules-systemjs@6.12.0 
    ├── babel-plugin-transform-es2015-modules-umd@6.12.0 
    └─┬ babel-plugin-transform-regenerator@6.11.4
      └── babel-plugin-syntax-async-functions@6.13.0 

and I notice a delay of a few seconds only.

n-riesco commented 7 years ago

I could reproduce this issue on a machine using npm 2.

Using npm dedupe or npm 3, as suggested here, helped me reduce the time to initialise babel to a few seconds.