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
Feature Request
When doing repeated calls to the crystal tools (
unreachable
,implementations
, etc) it has to callcompile_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.