You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be useful to help further debug compile time slowness by giving developers the tools to identify and report common slow-to-type-check expressions in their codebases. It would likely be another flag similar to `debug-time-function-bodies`.
…There are a few places that might make sense for this, but I suspect ConstraintSystem::solve() might be the best. This is ultimately called from a variety of places, and would provide the most insight into where time is being spent in the expression type checking. It’s possible something higher up the stack, like TypeChecker::solveForExpression or TypeChecker::typeCheckExpression() might make more sense as well. You can model this on how -debug-time-function-bodies is currently implemented, e.g. look at swift::performTypeChecking for some help on getting started.…
The text was updated successfully, but these errors were encountered:
This issue was created in October 2016. @rudkx added -warn-long-expression-type-checking= in d26c8592222, a commit from June 2017. I think that option takes care of the feature described in this task.
Maybe it also makes sense to add a -debug-time-expression-time-checking option, similar to -debug-time-function-bodies, which would allow developers to see the time it takes to type-check all expressions – but I imagine they could just as easily run -warn-long-expression-type-checking=1.
Note that `-debug-time-expression-type-checking` was added in #6729 (months before the warning option was added).
There is also `-solver-expression-time-threshold=<time in seconds>` which tells the expression type checker to give up after that amount of time. The threshold defaults to 60s, which is a very long time but was made that way in order to allow unoptimized builds and builds with instrumentation to not time out on reasonable (though still very long) type checking times. The non-time-based thresholds of memory usage, etc. that were in place before still apply - this is just an extra "backup" method so that people aren't waiting really long times thinking their build is going to eventually complete.
Additional Detail from JIRA
md5: c42786dc94b80bebe7ff685f51ac0207
Issue Description:
This could be useful to help further debug compile time slowness by giving developers the tools to identify and report common slow-to-type-check expressions in their codebases. It would likely be another flag similar to `debug-time-function-bodies`.
From Mark Lacy in this swift-dev thread:
The text was updated successfully, but these errors were encountered: