Merged
Conversation
amomchilov
commented
Mar 31, 2026
| sorbet("--print=missing-constants", "--quiet", "--stdout-hup-hack", "--no-error-count") | ||
| sorbet( | ||
| "--print=missing-constants", | ||
| "--stop-after=resolver", |
Contributor
Author
There was a problem hiding this comment.
This shaves ~7.1 seconds off tapioca todo in Shopify's core monolith.
$ hyperfine --warmup 5 --runs 30 \ache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count .'
'~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count --stop-after=resolver .' \
'~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count .'
Benchmark 1: ~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count --stop-after=resolver .
Time (mean ± σ): 7.445 s ± 0.223 s [User: 16.044 s, System: 24.579 s]
Range (min … max): 7.010 s … 7.955 s 30 runs
Benchmark 2: ~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count .
Time (mean ± σ): 14.582 s ± 0.757 s [User: 65.227 s, System: 19.900 s]
Range (min … max): 13.032 s … 16.134 s 30 runs
Summary
~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count --stop-after=resolver . ran
1.96 ± 0.12 times faster than ~/sorbet-master --no-config --cache-dir --print=missing-constants --quiet --stdout-hup-hack --no-error-count .
| "--print=missing-constants", | ||
| "--stop-after=resolver", | ||
| "--quiet", | ||
| "--stdout-hup-hack", |
Contributor
Author
There was a problem hiding this comment.
What is stdout-hup-hack? Do other calls need it?
Comment on lines
+91
to
+92
| unless supported_values.include?(table_type) | ||
| raise NotImplementedError, <<~MSG |
Contributor
Author
There was a problem hiding this comment.
Did not test this, because it's really just a note to future developers who try to use a new value here. They'll need to adjust the stop-after to ensure it reaches the part of the pipeline they care about.
| "--no-config", | ||
| "--quiet", | ||
| "--print=#{table_type}", | ||
| "--stop-after=namer", |
Contributor
Author
There was a problem hiding this comment.
This shaves 8.1 seconds off the various commands that use it (tapioca gem, tapioca dsl) in Shopify's core monolith.
$hyperfine --warmup 5 --runs 30 \
'~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet --stop-after=namer .' \
'~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet .'
Benchmark 1: ~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet --stop-after=namer .
Time (mean ± σ): 6.148 s ± 0.228 s [User: 10.487 s, System: 25.256 s]
Range (min … max): 5.778 s … 6.869 s 30 runs
Benchmark 2: ~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet .
Time (mean ± σ): 14.254 s ± 0.686 s [User: 65.621 s, System: 21.045 s]
Range (min … max): 13.169 s … 15.899 s 30 runs
Summary
~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet --stop-after=namer . ran
2.32 ± 0.14 times faster than ~/sorbet-master --no-config --cache-dir --print=symbol-table-json --quiet .
Morriar
reviewed
Apr 1, 2026
| raise NotImplementedError, <<~MSG | ||
| Got an unsupported value for `table_type` (#{table_type.inspect}). | ||
| The only supported values are: | ||
| #{supported_values.map { |v| "- #{v}" }.join("\n")} |
Contributor
There was a problem hiding this comment.
Nit: the \n from join won't have the heredoc indentation, so the second value will be unindented:
- symbol-table-json
- symbol-table-full-json
Suggested change
| #{supported_values.map { |v| "- #{v}" }.join("\n")} | |
| #{supported_values.map { |v| "- #{v}" }.join("\n ")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
These invocations wasted a lot of time doing a full Sorbet type-check, grabbing the printed output they cared about but ignoring the tc results.
Implementation
Use
--stop-afterto terminate the Sorbet run after we've gotten what we needed.Tests
None.