ionide / ionide/FsAutoComplete

High CPU in fsautocomplete.dll

Open
#1,464 21 comments 1 reaction 0 assignees View on GitHub
bug needs-upstream-work perf
Dominant language
F#
Stars
486
Forks
169
Avg merge
2d 8h
Merged PRs (30d)
5

Description

### Version

Ionide v7.31.1

### Dotnet Info

```
.NET SDK:
Version: 10.0.103
Commit: c2435c3e0f
Workload version: 10.0.102
MSBuild version: 18.0.11+c2435c3e0

Runtime Environment:
OS Name: pop
OS Version: 24.04
OS Platform: Linux
RID: ubuntu.24.04-x64
Base Path: /usr/lib/dotnet/sdk/10.0.103/

.NET workloads installed:
[wasm-tools]
Installation Source: SDK 10.0.100
Manifest Version: 10.0.102/10.0.100
Manifest Path: /home/david/.dotnet/sdk-manifests/10.0.100/microsoft.net.workload.mono.toolchain.current/10.0.102/WorkloadManifest.json
Install Type: FileBased

Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.3
Architecture: x64
Commit: c2435c3e0f

.NET SDKs installed:
10.0.103 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.3 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.3 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_BUNDLE_EXTRACT_BASE_DIR [/home/david/.cache/dotnet_bundle_extract]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
```

### Steps to reproduce

The problem seems to occur when I activate a tab for any source file in a particular project, or a tab for a higher level project that depends on that project. The CPU goes high and stays high.

The project is called `Client`, so you can find it in the provided trace logs.

Unfortunately, it is not open source, and it may become commercially valuable at some point, so I'm not happy to provide the source itself, but I can try experiments to track down the problem.

### Details

I expect the CPU to go up for a second or two while `FsAutoComplete` does it's parsing, but it stays high indefinitely. VSCode is still usable but my fan is blowing. If I close the source file tab and restart VSCode, the CPU is back to normal, but then when I open the file again, the CPU goes high and stays high. It is typically over 20%, but sometimes only around 10%.

The memory is also high, around 1.2GB while I was watching it in the System Monitor.
```
> ps -p 369018 -o %mem,cmd
%MEM CMD
2.1 /usr/bin/dotnet /home/david/.vscode/extensions/ionide.ionide-fsharp-7.31.1/bin/net9.0/fsautocomplete.dll --verbose --state-directory /home/david/.config/Code/User/workspaceStorage/29da2c99ab63e84b9115ef46bac97411/Ionide.Ionide-fsharp
```
In case any of this helps:
```
> fastfetch
///////////// david@mini-pc
///////////////////// -------------
///////*767//////////////// OS: Pop!_OS 24.04 LTS x86_64
//////7676767676*////////////// Host: AI Series (1.0)
/////76767//7676767////////////// Kernel: Linux 6.18.7-76061807-generic
/////767676///*76767/////////////// Uptime: 1 day, 16 mins
///////767676///76767.///7676*/////// Packages: 1817 (dpkg), 35 (flatpak-user)
/////////767676//76767///767676//////// Shell: fish 4.5.0
//////////76767676767////76767///////// Display (DELL U2725QE): 3840x2160 @ 1.55x in 27", 120 Hz [External]
///////////76767676//////7676////////// DE: COSMIC
////////////,7676,///////767/////////// WM: cosmic-comp (Wayland)
/////////////*7676///////76//////////// Theme: Yaru [GTK3]
///////////////7676//////////////////// Icons: Yaru [GTK3]
///////////////7676///767//////////// Cursor: Adwaita
//////////////////////'//////////// Terminal: cosmic-term
//////.7676767676767676767,////// CPU: AMD Ryzen AI 9 HX 370 (24) @ 5.16 GHz
/////767676767676767676767///// GPU: AMD Radeon 890M Graphics [Integrated]
/////////////////////////// Memory: 14.21 GiB / 60.44 GiB (24%)
///////////////////// Swap: 0 B / 20.00 GiB (0%)
///////////// Disk (/): 194.66 GiB / 1.78 TiB (11%) - ext4
Local IP (enp196s0): 192.168.1.213/24
Locale: en_US.UTF-8
```

### Logs

I set tracing to verbose.

[F#.log](https://github.com/user-attachments/files/25517893/F.log)
[Ionide.log](https://github.com/user-attachments/files/25517894/Ionide.log)

### Checklist

- [x] I have looked through existing issues to make sure that this bug has not been reported before
- [x] I have provided a descriptive title for this issue
- [x] I have made sure that that this bug is reproducible on the latest version of the package
- [x] I have provided all the information needed to reproduce this bug as efficiently as possible
- [ ] I or my company would be willing to contribute this fix

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.