-
Notifications
You must be signed in to change notification settings - Fork 832
Collect StackGuard stats #18941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collect StackGuard stats #18941
Conversation
|
|
I think one-off compilation/stackguard stats are much less interesting than long-running tooling stats. It is exposed via |
Yes, this PR also displays the stats live in VS experimental instance. What is interesting in one-off is the number of thread jumps, much higher than intuitively expected. In fact, switching off the stackguard gives noticeable boost to compilation times (well, unless a SO happens). |
Yes, that's why I have attempted to rewrite a bunch of places (like CE checking) to be tailrec from using SG, didn't go well. |
Another approach is to wrap the critical stuff with a trampolining CE, just like some things are already wrapped with |
I attempted this with |
Are the limits too defensive perharps? Intuitively, we would want to SG limit to be tightly below SO failure, meaning it should not affect perf in the happy path that much (basically just for the wrapper which should be inlined, but with no new thread). |
|
That FindUnsolved number of jumps is massive, and I think in there is just about collecting an unsorted list of unsolved type variables (could be replaced with mutation or an explicit queue/stack) |
|
/backport to release/dev18.0 |
|
Started backporting to release/dev18.0: https://github.com/dotnet/fsharp/actions/runs/18125805609 |
Yes, it should be relatively easy to rewrite it to explicit stack |


Description
Each stack guard thread jump currently spins up a new thread.
This adds metrics to count the jumps by the caller function name. With
--timesoption it could quickly give some limited insight into where the hot paths are.For example compiling FSC net10.0:
IcedTasks.Tests: