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

Integrating disk cache with the Rock caching system #11

Open
Kleidukos opened this issue Jul 9, 2024 · 1 comment
Open

Integrating disk cache with the Rock caching system #11

Kleidukos opened this issue Jul 9, 2024 · 1 comment

Comments

@Kleidukos
Copy link

Hi! I'm in the process of rewriting my compiler's driver to use Rock, and the experience is fantastic for now. :)

I had implemented a caching system that would hash the file (or its AST) in combination with the build flags, and get the final generated code directly from a store location.

Some context: I intend to make my compiler a daemon and have the CLI tool to be a lightweight client, like nocc where the daemon dies 15 seconds after the last client process has died. So I can't really keep all that stuff in memory, since two builds of the same project in a 16 seconds interval would have to rebuild the in-memory cache.

Do you think this method can be integrated in Rock's cache system? Or would it be easier to dump the cache of Rock on disk and reload it when starting the daemon process?

@ollef
Copy link
Owner

ollef commented Jul 9, 2024

Hey! I'm glad you're enjoying Rock so far. :)

I have yet to try caching results to disk yet, so it's uncharted territory as far as I know, and may involve some manual labor. I did have some code that would allow dumping Rock's cache to disk in Sixty for a while, but removed it since I wasn't ready to use it yet.

Anyway, it seems possible to dump the cache to disk (using an encoding of your choice) and reloading it at daemon startup. Trace verification should take care of reusing what is safe to reuse. So this seems worth trying as a first attempt.

Please report back on what you find out!

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

No branches or pull requests

2 participants