-
Notifications
You must be signed in to change notification settings - Fork 803
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
F#'s usage of ITextImage.GetText is causing large amount of data to get pushed onto LOH #5934
Comments
Saw this in another trace today, unfortunately our async implementation basically hides where this is coming from :( |
@cartermp, the original trace above came from my machine and from the structure of the project I was working on, and the VS settings, may give some hints:
Slowness seems mostly caused by the deepest files (i.e., the common project use by everything else). This has the most dense code, relatively large source files and a significant amount of XML DOC comments (though they're mostly just When editing these deep files, I often want to see the changes in the signature, so I'm hovering or ctrl-spacing for getting info tips. They typically appear only a minute or more later. Since for each tooltip the XML must be rendered as well, this may be a more likely candidate than it seems at first sight. Esp. if for rendering one tooltip, the whole assembly needs to be rendered; which I believe is the case. A possible solution to this and many other parsing issues would be that a hash code of function + XML is maintained and only if the hash value of the XML string changes, the XML is rendered again. In 99 out of 100 cases, the XML and the signature remains the same for most functions (only the implementation changes), or the change is additive: a new function is added. In such cases, keeping a hash map could prove beneficial, but I can imagine this is not a light change.
The CodeLens was on during above trace. Though in my experience it isn't as heavy as the rest, it seems to only to source rendering and no full parsing + compiling. The question is, though, whether this keeps references of the lines, in which case this is definitely a candidate for improvement: after a change and rendering is finished, ideally references to strings should be released and GC'ed.
I believe that when this trace was made, automatic brace completion was not part of the VS package yet (or was optional and I had it turned off). I would have to check to be sure, but I also agree that this is too rare to be of significant influence.
This project does not have out-of-project source files. There are a handful of linked source files (i.e., the AssemblyInfo.fs is shared through a project file link, and parts of it are overloaded), but I don't think that counts as out-of-project source files. There are a few xml and xslt files, but they are at the far end of the project and are rarely touched.
I assume you mean Basically my main working mode is typing a lot of code by heart and ignoring the red squigglies that appear and stay far longer than that the code is actually invalid. I just visually check the code and check it in so that the build server can check it. This is true for the deepest projects only, there's a significant difference when working on leaf projects (that are not depended on by other projects in the same solution). Also, I've cut my project in different solutions so that I can work on the common projects (the ones everything else depends on) without the rest being open. This helps so-so, and is often not a viable workaround. That said, recent updates to VS have improved editing experience (but bringing VS to an almost halt still happens regularly).
For this specific project I think that is unlikely but I am willing to make new traces with new VS versions if that's helpful. Also, I can share the project privately (with an NDA), or I can set up a remote session so we can have a look together at specific scenarios if that proves helpful. |
Closing out this old issue given how much work has been done in-between |
Trace: https://developercommunity.visualstudio.com/content/problem/245786/slow-f-editing-experience-up-to-a-minute-until-typ.html
GC Rollup By Generation
The F# stack above this doesn't make much sense to me, but our usage of ITextImage.GetText is causing 130 MB of data to pushed onto the LOH in the above trace.
The text was updated successfully, but these errors were encountered: