{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1160","labels_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1160/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1160/comments","events_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1160/events","html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/issues/1160","id":111162124,"number":1160,"title":"Performance Discussion: CPU Stress, Large Files, Large Solutions, Memory Stress, Enabled Features etc.","user":{"login":"dsyme","id":7204669,"avatar_url":"https://avatars.githubusercontent.com/u/7204669?v=3","gravatar_id":"","url":"https://api.github.com/users/dsyme","html_url":"https://github.com/dsyme","followers_url":"https://api.github.com/users/dsyme/followers","following_url":"https://api.github.com/users/dsyme/following{/other_user}","gists_url":"https://api.github.com/users/dsyme/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyme/subscriptions","organizations_url":"https://api.github.com/users/dsyme/orgs","repos_url":"https://api.github.com/users/dsyme/repos","events_url":"https://api.github.com/users/dsyme/events{/privacy}","received_events_url":"https://api.github.com/users/dsyme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-13T11:38:09Z","updated_at":"2015-10-14T19:08:03Z","closed_at":null,"body":"I've been looking into the CPU and Memory usage of VFPT briefly.  Repro using default settings with the latest VS gallery version:\r\n\r\n- Open VS2015\r\n- Open the big file \"TypeChecker.fs\" (without being in a project) from github.com/fsharp/fsharp or FCS\r\n- Wait for CPU acquiesce on the system\r\n- Make a one character change to the file and look at CPU and memory stats\r\n\r\nOn my laptop, the processing after a one character edit burns ~25 seconds of CPU time (quite a lot of it consuming 2 cores).   This feels like too much.\r\n\r\nI started to go through the VFPT features systematically (and very manually) to work out what's taking memory and CPU when editing a large standalone file like this.  Here's what I see for the different features: \r\n\r\n|  Feature | CPU | Memory |\r\n|:---------:|:------------:|:------------:|\r\n| addin disabled | 3 sec/edit  |     |\r\n| addin enabled, all features disabled | +0 sec/edit  |  +120MB |\r\n| Auto gen XML doc | +0 sec/edit  (?? on use) |    +0MB |\r\n| Source Code Formatting | +0 sec/edit  (?? on use) |    +0MB |\r\n| Navigation Bar | +0 sec/edit  |    +0MB |\r\n| Highlight References | +0 sec/edit (+6sec on first use after edit)  |    +200MB (after use) |\r\n| Rename Refactoring | +0 sec/edit  (+6sec on first use after edit) |    +80MB (after use) |\r\n| Indent Guides, Depth Colorizer | +2 sec/edit, but also got some long blocking (Gen2 GC?) pauses  |    +110MB (after use) |\r\n| Navigate To | +0 sec/edit  (?? on use) |    +80MB (?? on use) |\r\n| Colorize (no gray out options) | +7 sec/edit  (?? on use) |    +190MB  |\r\n| Colorize (gray out unused opens) | +27 sec/edit  (?? on use) |    +210MB  |\r\n| Colorize (gray out unused defns) | > 600sec on first open and each edit   |    +100MB  |\r\n| QuickInfo Panel  | +6 sec/edit   |   +190MB  |\r\n| FSharpLint  | +12 sec/edit   |   +40MB  |\r\n\r\nThere are some other features which I didn't check. \r\n\r\nOf these features, these stand out as being performance hogs:\r\n* colorization\r\n* \"gray out\" colorizations \r\n* FSharpLint \r\n* the QuickInfo Panel \r\n\r\nTo be honest these are all currently probably too greedy to have them on by default - or perhaps you can afford one of these on by default  (unless you reduce costs) but I suspect not all. The \"gray out\" colorizations are off by default already but FSharpLint and QuickInfo panel look like perhaps they shouldn't be on by default. \r\n\r\nThat said, I know there's been a lot work into performance in the last release and perhaps the CPU loads are now within system limits.  But proportionally, FSharpLint and QuickInfoPanel seem to be more performance intrusive than other features (I'm sure you know this) and should be the first ones for people to disable.\r\n\r\nAnother stress test is to open the F# compiler solution (fsharp.sln or all-vs2013.sln). Apart from startup the CPU times seem while editing to be much the same for the \"single file\" case above which is good - most edits should not incur a whole-project check.  Under the default settings, a single change to TypeChecler.fs soaks ~30seconds of CPU time.  With FSharpLint disabled it soaks ~15 seconds\r\n\r\nBased on the above I'd recommend we consider turning FSharpLint and QuickInfo Panel off by default - on performance grounds.  Or somehow degrade this functionality automatically (e.g. reduce update frequency) when the system is under stress.\r\n\r\nBest regards\r\ndon\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/comments/148160293","html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/issues/1160#issuecomment-148160293","issue_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1160","id":148160293,"user":{"login":"vasily-kirichenko","id":873919,"avatar_url":"https://avatars.githubusercontent.com/u/873919?v=3","gravatar_id":"","url":"https://api.github.com/users/vasily-kirichenko","html_url":"https://github.com/vasily-kirichenko","followers_url":"https://api.github.com/users/vasily-kirichenko/followers","following_url":"https://api.github.com/users/vasily-kirichenko/following{/other_user}","gists_url":"https://api.github.com/users/vasily-kirichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vasily-kirichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasily-kirichenko/subscriptions","organizations_url":"https://api.github.com/users/vasily-kirichenko/orgs","repos_url":"https://api.github.com/users/vasily-kirichenko/repos","events_url":"https://api.github.com/users/vasily-kirichenko/events{/privacy}","received_events_url":"https://api.github.com/users/vasily-kirichenko/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T19:08:03Z","updated_at":"2015-10-14T19:08:03Z","body":"About linter. I profiled VFPT with it enabled on same scenario as above, but on my laptop. Parse&Check took 12 seconds, Linter - 8 seconds (linting itself):\r\n\r\n```fsharp\r\nlet m = Markers.EnterSpan \"Lint\"\r\n                let res = \r\n                    Lint.lintParsedFile\r\n                        { Lint.OptionalLintParameters.Default with Configuration = Some config }\r\n                        { Ast = ast\r\n                          Source = source\r\n                          TypeCheckResults = None\r\n                          FSharpVersion = version }\r\n                        doc.FullName\r\n                m.Leave()\r\n```\r\n![image](https://cloud.githubusercontent.com/assets/873919/10494582/c522e1cc-72bf-11e5-8532-54073aaa56ac.png)\r\n\r\nHowever Linter runs in separate thread, it took too much time and definetly should be profiled. /cc @duckmatt "}}