Use Sorbet cache (if enabled)#2568
Use Sorbet cache (if enabled)#2568amomchilov wants to merge 1 commit intoAlex/use-prism-in-sorbet-callsfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
502c337 to
9c3e29b
Compare
1610659 to
3e06485
Compare
| # `--cache-dir=` disables the cache, modeled here with a `nil` value | ||
| cache_dir: if (value = options["--cache-dir"]).is_a?(String) | ||
| value.empty? ? nil : value | ||
| end, |
There was a problem hiding this comment.
I think this would be more readable outside of new, was there a specific reason to have it here?
Also should this use shellescape?
There was a problem hiding this comment.
Sure, I extracted local variables
Also should this use
shellescape?
I don't think so. The C++ code consumes these values directly, not mediated by a shell.
There was a problem hiding this comment.
Sure, I extracted local variables
Did you?
Are we missing a push?
There was a problem hiding this comment.
Looks like it. LGTM after that.
9c3e29b to
0189305
Compare
3e06485 to
57f7cb0
Compare

Motivation
If a repo has enabled the Sorbet cache, we should use it.
Implementation
Builds upon the
SorbetCache#2568.Performance
Shaves off around ~3s on the Shopify core monolith.
The cache stores the desugared ASTs, after the parsing, RBS rewriting, and desugaring is done. If there's a cache hit, no parsing happens, so that's why you see the legacy and Prism parsers have the same time. So this mitigates some of the benefit of #2567, but Prism is still helpful when there's a cache miss.
Tests
Added.