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

Cache compiler results for tools #14705

Open
nobodywasishere opened this issue Jun 12, 2024 · 0 comments
Open

Cache compiler results for tools #14705

nobodywasishere opened this issue Jun 12, 2024 · 0 comments

Comments

@nobodywasishere
Copy link
Contributor

Feature Request

When doing repeated calls to the crystal tools (unreachable, implementations, etc) it has to call compile_no_codegen each time, resulting in longer times to get information. I think there should be some mechanism / flag allowing for the AST to be cached once (based on a basic hash of the file contents or a top-level compile) and re-used over and over for the different tools. This shouldn't break backwards compatibility.

$ crystal tool unreachable file.cr            # takes a few seconds, but AST is cached
$ crystal tool implementations -c file.cr:1:3 # instantly returns as using cached AST
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

2 participants