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 dmypy recheck times #6722

Open
chadrik opened this issue Apr 25, 2019 · 2 comments
Open

slow dmypy recheck times #6722

chadrik opened this issue Apr 25, 2019 · 2 comments

Comments

@chadrik
Copy link
Contributor

chadrik commented Apr 25, 2019

Hi, I'm creating an issue for a problem discussed with @ilevkivskyi over at dropbox/mypy-PyCharm-plugin#26

Ivan indicated that he's getting 300-500ms response time from dmypy on rechecks of a large code base, but on my moderately large code base, dmypy is taking over 15s to rerun if I edit any files.

I'm using 0.701.

First I start the daemon:

$ dmypy run -v -- python/packages
err                     : 
out                     : python/packages/filesize.py:51: error: I ...
platform                :     darwin
python_version          :        2_7
roundtrip_time          :     20.145
stats                   : {
'validate_meta_time': 0.005048990249633789,
'files_parsed': 819, 
'modules_parsed': 520, 
'stubs_parsed': 299, 
'parse_time': 4.495372295379639, 
'find_module_time': 0.3217315673828125, 
'find_module_calls': 5739, 
'graph_size': 819, 
'stubs_found': 299, 
'graph_load_time': 5.5668110847473145, 
'fm_cache_size': 1936, 
'sccs_left': 0, 
'nodes_left': 0, 
'cache_commit_time': 4.0531158447265625e-06, 
'load_fg_deps_time': 9.5367431640625e-07
}
status                  :          1

Then I edit a file and recheck:

$ dmypy recheck -v --update python/packages/foo.py
err                     : 
out                     : python/packages/foo.py:1 ...
platform                :     darwin
python_version          :        2_7
roundtrip_time          :     17.837
stats                   : {
'load_fg_deps_time': 2.5272369384765625e-05, 
'validate_meta_time': 1.3113021850585938e-05, 
'files_parsed': 1, 
'modules_parsed': 1, 
'stubs_parsed': 0, 
'parse_time': 0.002131938934326172, 
'find_module_time': 0.005670785903930664, 
'find_module_calls': 4, 
'semanal_time': 0.0036809444427490234,
'typecheck_time': 0.0034759044647216797, 
'deps_time': 0.001669168472290039, 
'finish_passes_time': 0.0005908012390136719, 
'update_isolated_time': 0.021294116973876953, 
'propagate_time': 0.003412961959838867, 
'find_changes_time': 0.0008490085601806641, 
'fg_update_time': 17.824305057525635,
'files_changed': 1
}
status                  :          1

Clearly the problem lies in fg_update_time!

It may be important to note that this code produces hundreds of errors. I'm using a custom mypy runner to filter out errors I'm not concerned with until my message filtering PR gets some traction.

Here's my mypy.ini:

[mypy]
python_version = 2.7
ignore_missing_imports = true
follow_imports = skip
warn_no_return = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true

Any guidance is greatly appreciated!

@ilevkivskyi
Copy link
Member

It may be important to note that this code produces hundreds of errors. I'm using a custom mypy runner to filter out errors I'm not concerned with until my message filtering PR gets some traction.

Hm, this may be the cause @msullivan what do you think? We recheck every target with error, right?
IIRC we already have an issue about not depending on re-checking targets with errors (because we already discussed this), but I can't find one.

(Also sorry for not reviewing your PR, which is a nice improvement, we are a small team and don't have enough time for everything.)

@chadrik
Copy link
Contributor Author

chadrik commented Apr 25, 2019

Hm, this may be the cause @msullivan what do you think? We recheck every target with error, right?
IIRC we already have an issue about not depending on re-checking targets with errors (because we already discussed this), but I can't find one.

(Also sorry for not reviewing your PR, which is a nice improvement, we are a small team and don't have enough time for everything.)

No worries, I understand. The interesting thing is that my message filtering PR (#6472) could actually be another solution to this, since native error filtering would mean that mypy is actually aware of what's an error and what's not, based on my filter settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants