You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slow incremental run when single module has errors #4135
The performance problem is apparently not new -- I can reproduce this with standard -i mode as well. No cache entries for the mypy package are written somehow -- perhaps because mypy.x precedes all other submodules of mypy. This could be due to an edge case in the topsort.
This is blocking progress in fine-grained incremental mode. ASTs can't be reused when there is an error. In fine-grained incremental mode we want to cache every module that has no blocking errors. I'll try to fix or work around this.
I've got a clue about why this is happening: in build.py, in State.write_cache(), on line 1943, there's a check for self.manager.errors.is_errors(). But this returns True when there was an error in any previous file! And then two lines down we actually call delete_cache(). (This was added recently in PR #4045.)
What we actually need is a little different -- we want to check if the current SCC or any of its dependents has errors.
Activity
JukkaL commentedon Oct 19, 2017
@gvanrossum in #4130 (comment):
gvanrossum commentedon Nov 7, 2017
Adding topic-daemon label because this impedes one of the important use cases for the daemon (quickly rechecking code with errors).
JukkaL commentedon Nov 17, 2017
This is blocking progress in fine-grained incremental mode. ASTs can't be reused when there is an error. In fine-grained incremental mode we want to cache every module that has no blocking errors. I'll try to fix or work around this.
JukkaL commentedon Nov 20, 2017
I've worked around this in my local branch (but have not fixed the underlying issue).
gvanrossum commentedon Dec 6, 2017
I've got a clue about why this is happening: in build.py, in State.write_cache(), on line 1943, there's a check for self.manager.errors.is_errors(). But this returns True when there was an error in any previous file! And then two lines down we actually call delete_cache(). (This was added recently in PR #4045.)
What we actually need is a little different -- we want to check if the current SCC or any of its dependents has errors.
Don't delete cache on all errors -- only on errors in dependencies
Don't delete cache on all errors -- only on errors in dependencies
Only delete cache errors in dependencies -- take two
Fix incremental speed regression (#4331)