Skip to content

Write errors to a separate cache file#21022

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:errors-separate-file
Mar 17, 2026
Merged

Write errors to a separate cache file#21022
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:errors-separate-file

Conversation

@ilevkivskyi
Copy link
Member

This is needed for staggered interface/implementation processing in the parallel checking.

Implementation is straightforward. A non-trivial part is that it looks like we need to always write/read errors file, even if empty. Otherwise we risk getting into a stale state in some edge cases. This adds few milliseconds warm cache runs, but still under noise level for both self-check and -c 'import torch'.

@ilevkivskyi ilevkivskyi requested a review from JukkaL March 15, 2026 12:53
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should turn on sqlite cache by default now, since this will likely have a bigger overhead on systems where sqlite cache improves performance (e.g. macOS, systems with endpoint security software).

@ilevkivskyi
Copy link
Member Author

I wonder if we should turn on sqlite cache by default now, since this will likely have a bigger overhead on systems where sqlite cache improves performance (e.g. macOS, systems with endpoint security software).

Can you make a more precise measurements on Mac? I am curious how much of impact this will have there. In any case, I am not against sqlite cache. I will leave the decision on when exactly to flip the switch to you.

@ilevkivskyi ilevkivskyi merged commit 7ff36ef into python:master Mar 17, 2026
24 checks passed
@ilevkivskyi ilevkivskyi deleted the errors-separate-file branch March 17, 2026 22:24
@JukkaL
Copy link
Collaborator

JukkaL commented Mar 18, 2026

Ok, I'll run some benchmarks and make a decision about turning on sqlite cache this week.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants