Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow import time #289

Open
disconnect3d opened this issue Nov 22, 2024 · 0 comments
Open

Slow import time #289

disconnect3d opened this issue Nov 22, 2024 · 0 comments

Comments

@disconnect3d
Copy link

disconnect3d commented Nov 22, 2024

Hi,

The import time of ipdb is super slow. It would be awesome if we can get it improved as it is a bit embarassing that importing ipdb is ~6x slower than pdb (on intel mac; and I have seen it being even slower on a Linux VPS, like 0.5s vs 0.01s).

Below is a quick benchmark of it:

$ pip freeze
pytasttokens==2.4.1
decorator==5.1.1
executing==2.1.0
ipdb==0.13.13
ipython==8.29.0
jedi==0.19.2
matplotlib-inline==0.1.7
parso==0.8.4
pexpect==4.9.0
prompt_toolkit==3.0.48
ptyprocess==0.7.0
pure_eval==0.2.3
Pygments==2.18.0
six==1.16.0
stack-data==0.6.3
traitlets==5.14.3
wcwidth==0.2.13

$ python --version
Python 3.12.7

$ cat import-pdb.py
import pdb

$ cat import-ipdb.py
import ipdb

$ hyperfine "python import-pdb.py"
Benchmark 1: python import-pdb.py
  Time (mean ± σ):      75.4 ms ±   3.8 ms    [User: 49.0 ms, System: 17.1 ms]
  Range (min … max):    69.6 ms …  90.4 ms    33 runs

$ hyperfine "python import-ipdb.py"
Benchmark 1: python import-ipdb.py
  Time (mean ± σ):     422.4 ms ±  22.4 ms    [User: 321.4 ms, System: 82.2 ms]
  Range (min … max):   402.2 ms … 470.4 ms    10 runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant