PyDev import times are 10x slower than using command line

Viewed 172

I'm new to python and using PyDev with Eclipse I noticed excruciatingly slow startup time whenever I try to execute the code I'm working on. I narrowed this down to libraries import.

For example if I run the following code

import timeit
startTime = timeit.default_timer()

import numpy as np
print("loaded numpy: ", timeit.default_timer() - startTime)

import pandas as pd
print("loaded pandas: ", timeit.default_timer() - startTime)

from pandas import ExcelWriter
print("loaded sub-pandas 1: ", timeit.default_timer() - startTime)

from pandas import DataFrame
print("loaded sub-pandas 2: ", timeit.default_timer() - startTime)

import timeit
print("loaded timeit: ", timeit.default_timer() - startTime)

from sqlalchemy.sql.expression import false
print("loaded sqlalchemy: ", timeit.default_timer() - startTime)

import os
print("loaded os: ", timeit.default_timer() - startTime)

It will benchmark time for PyDev as:

    loaded numpy:  6.791420515378803
    loaded pandas:  13.315319435084618
    loaded sub-pandas 1:  13.31538835744522
    loaded sub-pandas 2:  13.315418989605488
    loaded timeit:  13.315443057731413
    loaded sqlalchemy:  13.668371856921556
    loaded os:  13.668398113058927

while with command line execution it will be:

loaded numpy:  1.6967744335238362
loaded pandas:  3.7941380255968165
loaded sub-pandas 1:  3.7944563812624534
loaded sub-pandas 2:  3.795081787867914
loaded timeit:  3.795144146194173
loaded sqlalchemy:  3.915562085554165
loaded os:  3.915884087905548

Can anybody help with getting to the bottom of this? Even with the command line option 4s for loading a couple of standard libraries seems to be an overkill.

Thank you!

1 Answers
Related