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
Add troubleshooting section for F# 10 high CPU workaround
Document the FSharp_CacheEvictionImmediate=1 env var workaround
for the FCS type subsumption cache hashing bug (dotnet/fsharp#19369).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,23 @@ type T = HtmlTypeProvider.Template<
118
118
>
119
119
```
120
120
121
+
## Troubleshooting
122
+
123
+
### High CPU usage in IDE with .NET 10 / F# 10
124
+
125
+
If you experience sustained high CPU from `fsautocomplete` (the F# language server) when using this provider with F# 10, it is caused by an [FCS bug](https://github.com/dotnet/fsharp/pull/19369) in the type subsumption cache where `TypeStructure.GetHashCode` performs O(n) hashing on every cache lookup.
126
+
127
+
**Workaround:** Set the environment variable `FSharp_CacheEvictionImmediate=1` before launching your editor. This switches the cache eviction strategy from a background worker (which continuously rehashes) to synchronous inline eviction, eliminating the CPU spike while keeping the cache functional.
128
+
129
+
On macOS (persists until reboot):
130
+
```bash
131
+
launchctl setenv FSharp_CacheEvictionImmediate 1
132
+
```
133
+
134
+
On Linux/Windows, set the variable in your shell profile or system environment variables.
135
+
136
+
After setting it, fully restart your editor (not just reload).
137
+
121
138
## Safety
122
139
123
140
- All text content holes are HTML-encoded via `System.Net.WebUtility.HtmlEncode`
0 commit comments