Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add frontend option "-warn-long-function-bodies=<N>".
This is a /slightly/ more user-friendly option than -debug-time-function-bodies; pass it a limit in milliseconds and the compiler will warn whenever a function or multi-statement closure takes longer than that to type-check. Since it's a frontend option (and thus usually passed with -Xfrontend), I went with the "joined" syntax as the common case. The usual "separate" syntax of "-warn-long-function-bodies <N>" is also available. As a frontend option, this is UNSUPPORTED and may be removed without notice at any future date. Additional caveats: - Other parts of type-checking not measured by this may also be slow. - May include first-use penalties (i.e. "this is slow because it's the first function that references an imported type, which causes many things to be imported") - Does not report anything whatsoever about other phases of compilation (SILGen, optimization, IRGen, assembly emission, whatever). - Does not catch anything accidentally being type-checked multiple times (a known issue for initial value expressions on properties).
- Loading branch information
1 parent
ecd8821
commit 18c7592
Showing
9 changed files
with
107 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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