Skip to content

Always write the -i cache #3045

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
gvanrossum opened this issue Mar 22, 2017 · 3 comments
Closed

Always write the -i cache #3045

gvanrossum opened this issue Mar 22, 2017 · 3 comments

Comments

@gvanrossum
Copy link
Member

I've noticed that many people initially run plain mypy and then start using mypy -i but find that the first such run is not any faster than a plain run. This is understandable because it needs to warm the cache first.

We could alleviate this issue by just always writing the cache (perhaps allowing this feature to be turned off for special scenarios but having it on by default). This might cost a little bit of extra run time -- IIRC I once measured the cost of writing the cache and it was in the 5-10% range.

@ambv
Copy link
Contributor

ambv commented Mar 26, 2017

It would then be cleaner to simply default to the -i behavior entirely and only allow a non-cache variant as an option.

@gvanrossum
Copy link
Member Author

I'm torn about that. Historically -i mode has had a lot of instabilities around edge cases, which would make this problematic -- but some of that is because it's not on by default, so maybe enabling it by default is better because it'll get more testing. Also, at Dropbox it suffered from not flushing the cache when the mypy version changes, but that's been fixed recently (#2992).

Calling for additional opinions?

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 27, 2017

Writing the cache always seems reasonable to me, since the performance overhead is pretty minor but the potential speedup from being able to use -i is significant. Turning it off manually could be useful at least for CI jobs that won't ever run mypy twice.

I feel like turning -i on by default is a little risky, since it has historically been unstable and we don't have very good CI around it yet. Regressions to -i can still slip through quite easily. I'd suggest we wait until we have better testing around it.

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

3 participants