Skip to content

Daemon mode optimal behavior when there are no module interface changes #4212

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

Closed
JukkaL opened this issue Nov 6, 2017 · 5 comments
Closed
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 6, 2017

I'm recording an idea so that I won't lose track of it. It's possible be that this is how dmypy already works.

Assume that module a imports b and we are using dmypy. Assume that a is much larger than b (it could be many modules). Now we modify b so that the public interface doesn't change. We could consider a dirty and process it to ensure that there won't be any references to the old version of b in the in-memory cache. This would be expensive, however. An alternative would be to not process a but to just drop the module from the in-memory cache (while retaining the JSON cache file). This way any sequence of internal modifications to b would be very fast as they'd only require processing b.

@gvanrossum Please close this if this is how dmypy already works (or if this is a bad idea).

@gvanrossum
Copy link
Member

I think the latest PR (dmypy3 branch) essentially works this way. I'll keep this open until I'm sure.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Nov 7, 2017

It looks like the dmypy3 branch works like this when there are no errors, but once there is an error, it'll process all dependencies. It would be great if this could be extended to handle errors.

@gvanrossum
Copy link
Member

gvanrossum commented Nov 7, 2017 via email

@gvanrossum gvanrossum self-assigned this Dec 11, 2017
gvanrossum pushed a commit to gvanrossum/mypy that referenced this issue Dec 13, 2017
… cache

Closes python#4212.

However, there are still many scenarios where a trivial error affects
the interface hash and hence causes a recheck of everything
downstream.

Also, this affects regular incremental mode too (making it faster, but
if there's a bug in my logic, it will also be hit by that bug.)
gvanrossum pushed a commit to gvanrossum/mypy that referenced this issue Feb 2, 2018
… cache

Closes python#4212.

However, there are still many scenarios where a trivial error affects
the interface hash and hence causes a recheck of everything
downstream.

Also, this affects regular incremental mode too (making it faster, but
if there's a bug in my logic, it will also be hit by that bug.)
@gvanrossum
Copy link
Member

I don't think I have the chops to fix this, so unassigning.

@gvanrossum gvanrossum removed their assignment Oct 1, 2018
@JukkaL
Copy link
Collaborator Author

JukkaL commented Oct 2, 2018

This should already work efficiently in fine-grained incremental mode, so I don't think that there's anything that needs to be done any more.

@JukkaL JukkaL closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants