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

import probablepeople makes VScode debugger startup extremely slow #86

Open
fabiosangregorio opened this issue Mar 29, 2019 · 1 comment

Comments

@fabiosangregorio
Copy link

Expected Behavior

import probablepeople while debugging should take less than a second.
python main.py command should take less than a second to complete, with main.py as follows:

import probablepeople
print('hello world')

Current Behavior

import probablepeople while debugging in VScode takes about 20 seconds.
python main.py command takes less than a second to complete.0

Steps to Reproduce

  1. Create main.py with contents listed above
  2. Place a breakpoint on line 2.
  3. Start debug.
  4. Wait 20 seconds.
  5. The execution gets paused on the breakpoint.

Context (Environment)

  • Windows 10 64-bit
  • Visual Studio Code v1.32.3 x64
  • vscode-python debugger

What I tried

  • Reinstalled vscode-python
  • Tried multiple imports from heavy modules to check if the problem occurs with other imports
@fabiosangregorio
Copy link
Author

I also opened an issue on the ptvsd repository.
As they replied here:

I investigated this and unfortunately there's not much to be done in the debugger side (although it could be fixed in the probablepeople side and possibly on Python itself).
So, what I found out is that the slowdown happens when probablepeople does: from .ratios import ratios -- the file imported (probablepeople/ratios.py) appears to have just a giant dictionary literal with more than 154k lines.
The fix on probablepeople would be loading that data from a file instead of creating a giant dictionary

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