Skip to content
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

Editing a file with UI code (that has "open Bolero.Html") is very slow #272

Open
kgday opened this issue Sep 15, 2022 · 11 comments
Open

Editing a file with UI code (that has "open Bolero.Html") is very slow #272

kgday opened this issue Sep 15, 2022 · 11 comments

Comments

@kgday
Copy link

kgday commented Sep 15, 2022

Admittedly I haven't got a very good computer at present, but when editing F# , the experience is usually Ok, including in a bolero project that is not referencing Bolero.Html.

However, when one has to reference Bolero.Html, the CPU usage fo visual studio hits the roof and stays there for a long time. During this time, the colorization and intellense is not working. If I continue typing , it reaches a point that we get a lag for each character. It makes doing UI design work terrible. Likewise if using templates. The template html file is ok but when you then in the fs file where you have to reference that template you get the same deal.

I have reduced the affected code a little bit by putting view functions and code in separate files to the model, message and updates, they by isolating the painful stuff.

I see the same issue when creating a new project from the latest Bolero templates.

I would hope someone has a solution to this. Is there are setting in Visual Studio I can set? I have tried a bunch of stuff, including turning off Intellicode for fs files.

@michaelsg
Copy link

michaelsg commented Sep 30, 2022

Same problem. I verified identical behavior in Rider and someone on Slack verified that it happens in VSCode, too. Sounds like a compiler issue. Compiling those files takes a lot longer, too. Perhaps all the builders are just too much for the compiler - or the aggressive inlining? I have resorted to lots of heavy sighs and breaking my views out into smaller and smaller files just to make the editing experience tolerable.

@Martin521
Copy link

For me, the latest version of VS Code has improved this a lot. Just the usual brief CPU load for analysis when the files are loaded.

@Tarmil
Copy link
Member

Tarmil commented Oct 19, 2022

As far as I can tell (feel free to correct me if I'm wrong), this happens when adding a bunch of attributes in an element, and not when adding a bunch of children. I think the problem is that there's a lot of method overloads to resolve. I'll try to find an alternative representation that doesn't need as many overloads, preferably without losing the advantage of enforcing the order.

Edit: Correction, it seems to happen just as much with a lot of attributes or a lot of elements.

@Tarmil
Copy link
Member

Tarmil commented Oct 23, 2022

I've managed to test with various IDEs, and it seems that their latest versions are all fine. I am using this repository, and here are the IDEs I've been able to test:

Editor Status
VSCode + Ionide 7.3.1 OK
Rider 2021.3.4 Crash
Rider 2022.2.3 OK
Visual Studio 17.0.0 Crash
Visual Studio 17.3.6 OK

@kgday, @michaelsg: Are you able to try your own code with one of the versions listed as OK above to verify if they work for you?

@kgday
Copy link
Author

kgday commented Oct 23, 2022

Hi Tarmil, I am currently on vis studio 17.3.5. I will aim to update next week if not this week and let you know.

@kgday
Copy link
Author

kgday commented Nov 9, 2022

I am not experiencing the lagginesss in the typing - however I have a much faster computer now. Intellisense is still very slow though not really usable. Now on Visual Studio 17.4

@kgday
Copy link
Author

kgday commented Nov 9, 2022

Also very similar for vs Code + Ionide 7.4

@michaelsg
Copy link

Sorry for delay. I do not have one of those specific versions.
I'm currently on Version 17.5.0 Preview 1.0 (VS).
It is still unbearably slow.

Having done several Fable elm-y apps, Bolero is my favorite. Except for the compile times and the lack of any editor help, I'm loving it. I really hope we can find out what is causing this.

Microsoft Visual Studio Enterprise 2022
Version 17.5.0 Preview 1.0
VisualStudio.17.Preview/17.5.0-pre.1.0+33103.201

Microsoft .NET Framework
Version 4.8.04084

Visual F# Tools 17.5.0-beta.22525.1+90f5b1ed0befe8337b923860d29dcd62d4735aef
Microsoft Visual F# Tools

@Martin521
Copy link

It seems the compiler service / FsAutoComplete is just very slow with CEs. I have started playing with FParsec, and here I can really see it, in a very small project. Here it becomes annoying (while with Bolero it is still acceptable in my case).

@Martin521
Copy link

I found that everything is still fine when I open the project (my fparsec project in this case). Over time it gets worse and worse. Probably correlated: VS Code uses more and more memory.

@Martin521
Copy link

Hopefully, this will improve the situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants