probablepeople
probablepeople copied to clipboard
import probablepeople makes VScode debugger startup extremely slow
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
- Create main.py with contents listed above
- Place a breakpoint on line 2.
- Start debug.
- Wait 20 seconds.
- 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
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