Skip to content

MarkerService and ProblemsView do not scale well and block UI thread #11976

Closed

Description

  • VSCode Version: 1.5.2
  • OS Version: Tested Windows 10 and macOS 10.11

Repro steps:

  1. Clone https://github.com/DustinCampbell/diagnostic-perf-test
  2. Open the diagnostic-perf-test project in VS Code
  3. F5 to compile and launch the extension under the debugger
  4. In the debuggee process, select View->Problems to display the Problems pane.
  5. In the debuggee process, select View->Command Palette... and execute the Populate Diagnostics command.

At this point, the VS Code debuggee window will stop responding as it populates a single diagnostic for 2000 files. This is very similar to the diagnostics produced for a medium- to large-sized C# solution (say, one generated by Unity) where there are a couple thousand files and each has a single "remove unnecessary using directives" diagnostic.

Expected result:

  • Populating diagnostics should not scale exponentially by the number of files.
  • Calling DiagnosticCollection.set(...) should periodically free up the UI thread while processing.

Activity

  1. added
    bug
    on Sep 14, 2016
  2. added
    freeze-slow-crash-leak
    and removed on Sep 19, 2016
  3. jrieken commented on Sep 19, 2016

    @jrieken
    Contributor

    The problem is that we call changeOne per uri+owner combination which leads to many events. Processing those events (problems view) takes a long time. We should not fire so many events...

    CPU-20160919T115033.cpuprofile.zip

    screen shot 2016-09-19 at 11 54 19

  4. jrieken commented on Sep 19, 2016

    @jrieken
    Contributor

    We have found a couple of issues

    • event storm by emitting in the loop
    • the problems view sorting and filtering all elements
  5. jrieken commented on Sep 19, 2016

    @jrieken
    Contributor

    Sandeep Somavarapu (@sandy081) I have pushed changes to send all events at once and to make reading of markers a little faster. that improves the situation a tiny bit. as discussed the culprit is the problems view. pls continue from here

  6. sandy081 commented on Sep 19, 2016

    @sandy081
    Member

    Thanks Johannes Rieken (@jrieken) for the changes. I will do the improvement is problems view as discussed.

  7. 4 remaining items

  8. jrieken commented on Sep 21, 2016

    @jrieken
    Contributor

    reopening for me to further improve MarkerService#read. That 1 second must go ;-)

  9. jrieken commented on Sep 22, 2016

    @jrieken
    Contributor

    🐎 MarkerService#read from 1000ms down to 2.5ms. Slightly embarrassing it wasn't like this to begin with...

    screen shot 2016-09-22 at 09 16 01

  10. jrieken commented on Sep 22, 2016

    @jrieken
    Contributor

    Sandeep Somavarapu (@sandy081) The last big chunk is Tree#expand which you might wanna consult with João Moreno (@joaomoreno) if it can be improved.

    screen shot 2016-09-22 at 09 19 51

  11. sandy081 commented on Sep 28, 2016

    @sandy081
    Member

    I added another fix/improvement while applying filters.

    Using Tree.expand on each item or Tree.expandAll is not making any difference.
    Will discuss with João Moreno (@joaomoreno) and see if I can improve this.

    Otherwise Closing this since we improved performance drastically.

  12. changed the title [-]DiagnosticCollection does not scale well and blocks UI thread[/-] [+]MarkerService and ProblemsView do not scale well and block UI thread[/+] on Sep 28, 2016
  13. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfreeze-slow-crash-leak

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions