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

Add caching on disk #47

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Add caching on disk #47

merged 2 commits into from
Aug 14, 2024

Conversation

rkthomps
Copy link
Contributor

Start thinking about caching file context on disk so that cached proof files are available across processes. Here are the possible issues with this implementation:

  • Only depends on the "libraries hash". Does not depend on CoqPyt version or Coq version.
  • Hash does not take into account file dependencies. Not sure if that affects correctness.

With that being said this significantly speeds up time for ProofFiles.
For example, the tests go from 94s to 55s on subsequent runs.
Time to run a Proof File for Sudoku.v in the Sudoku repo goes from 199s to 33s.

I think this is important since many files share dependencies even if they are in different projects.

Copy link
Member

@Nfsaavedra Nfsaavedra left a comment

Choose a reason for hiding this comment

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

Yap, this is very important and useful! Thanks!
It's true that the hash does not consider the dependencies and that may affect correctness if the files in the dependencies change, but I believe that's a trade-off we have to accept. Can you please add a comment to the doc string of ProofFile mentioning that? Also, I suggest to add a static method to the ProofFile class that allows to toggle the disk cache. Other than that, LGTM, thanks! 😄

@rkthomps
Copy link
Contributor Author

I added documentation on the ProofFile object, and made it optional (off by default). I also added a test for the disk caching.

Copy link
Member

@Nfsaavedra Nfsaavedra left a comment

Choose a reason for hiding this comment

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

LGTM! Merging. Thanks!

@Nfsaavedra Nfsaavedra merged commit cb55eca into sr-lab:master Aug 14, 2024
4 checks passed
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