ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Coverage Gutters: Display Coverage with Watch off much slower than in previous versions #182

Closed markf-hubdoc-com closed 5 years ago

markf-hubdoc-com commented 5 years ago

Describe the bug In my workspace in which "Coverage Gutters: Watch" is off, 9 editor tabs are open and 69 files have coverage data execution of the "Coverage Gutters: Display Coverage" command takes about 72 seconds before the Gutters are displayed.

In another of my workspaces with 2 open editor tabs and 19 covered files, it takes 11 seconds for Coverage Gutters to display.

Until recently this command took at most 1 second to run in the same workspaces with similar numbers of open editor tabs and files with coverage data in coverage/lcov.info.

To Reproduce Steps to reproduce the behaviour:

  1. Run Mocha tests for a JavaScript project with unit test coverage measured by nyc via istanbul;
  2. Generate coverage/lcov.info from nyc-captured coverage data via nyc;
  3. Start VS Code;
  4. File | Open..., navigate to the JavaScript project folder, Open;
  5. run Coverage Gutters: Display Coverage;
  6. wait for 0.5 to 1.1 seconds per covered file before the Coverage Gutters are Displayed.

Expected behaviour Coverage Gutters display in no more than 1 second.

Screenshots Log from workspace 1:

[1540918289897][coverageservice]: LOADING
[1540918305856][coverageservice]: Loading 9 file(s)
[1540918362420][coverageservice]: Caching 69 coverage(s)
[1540918362420][coverageservice]: READY
[1540918362420][coverageservice]: RENDERING
[1540918362420][renderer][section file path]: /Users/USER/PATH/FILE.js
[1540918362421][coverageservice]: READY

Log from workspace 2:

[1540918616906][coverageservice]: LOADING
[1540918624598][coverageservice]: Loading 2 file(s)
[1540918627246][coverageservice]: Caching 19 coverage(s)
[1540918627246][coverageservice]: READY
[1540918627246][coverageservice]: RENDERING
[1540918627246][renderer][section file path]: /Users/USER/OTHERPATH/OTHERFILE.js
[1540918627247][coverageservice]: READY

Desktop (please complete the following information):

Additional context None yet.

ryanluker commented 5 years ago

@markf-hubdoc-com Thanks for submitting an issue. This performance decrease is because of a recent bug when we did some cleanup of the ignored globs (which is fixed in here setting https://github.com/ryanluker/vscode-coverage-gutters/commit/e52be98b633c64c402925dee8d50e90fb018813d). Can you try the vsix I attached to this comment to see if this fixes the speed issue (first uninstall the extension then use >install from the command pallet with the file below)?

vscode-coverage-gutters-2.2.1.zip

jledentu commented 5 years ago

Hi,

I have the same issue here. @ryanluker I tried the .vsix you attached, but it doesn't seem to fix the issue. I'll get a look into this if I find some time.

Thanks,

markf-hubdoc-com commented 5 years ago

You're welcome, @ryanluker! Thanks for the explanation of what is going on. I uninstalled version 2.2.1 of then installed the above .vsix but did not observe any significant change in performance: 70 seconds to show gutters in my first workspace, 11 seconds in my seconds workspace.

I am more than happy to test out any other fix candidates - just let me know. Thanks for the amazing product!

(@jledentu: thank you for confirming my observations - good to know it's not just me. :) )

markf-hubdoc-com commented 5 years ago

Downgrading to 2.2.0 and disabling Visual Studio Code auto-update of extensions allows me to work around this issue until fixed.

For those unaware of how to do this, in VS Code:

ryanluker commented 5 years ago

@jledentu @markf-hubdoc-com thanks for the updates. I am hoping to take a look at this over the weekend and will probably do a 2.2.2 release once I figure out the issue.

ryanluker commented 5 years ago

@jledentu @markf-hubdoc-com I think I figured out the issue https://github.com/ryanluker/vscode-coverage-gutters/commit/555e0d0c95257b2c05798793c4de3597b144520d and added a test https://github.com/ryanluker/vscode-coverage-gutters/commit/2d9142dbcb39f9f254f2e69dd27f7a30dfb8b140 as well to catch these kind of large codebase issues in the future. Can you guys try 2.2.2 attached to this comment?

vscode-coverage-gutters-2.2.2.zip

jledentu commented 5 years ago

@ryanluker I tested your attachment and I confirm that this solves my issue (I didn't measure the improvement, through, but it's now comfortable). Thanks a lot!

markf-hubdoc-com commented 5 years ago

@ryanluker I just tried the attached 2.2.2 out. I found coverage reload times to be much improved and close to those of 2.2.0: 890 ms to reload coverage on my larger project, 800 ms on my smaller project. That's close to the performance before 2.2.1, way better than the 70 second and 11 second times I was respectively observing with 2.2.1 and quite reasonable for interactive use overall performance. Nice fix!

ryanluker commented 5 years ago

@jledentu @markf-hubdoc-com thanks a bunch for getting back to me with the good news. I will go ahead with making an official 2.2.2 release here in the near future when I find some free time.

markf-hubdoc-com commented 5 years ago

You're most welcome, @jledentu. I'll be sure to test out the official release when you get that chance. Thanks!

KaiserCoaster commented 5 years ago

Figured I'd also share my results. This is my first time trying to use the plugin, so I wasn't even sure if I set it up correctly or if this was normal, but it took 3min 45 sec (225s) to load 5 files with a 20kb lcov. After installing 2.2.2, that's down to 2 seconds. (And only loaded 1 file?) Thanks for the fix on that!

mtycholaz commented 5 years ago

@ryanluker This fix is better, but still not as good as the previous version. I work with a single 450kb+ lcov file for our project (3000+ unit tests). Takes about 2min 45 sec to update after a change.

ryanluker commented 5 years ago

Going to close this issue as it was related to the glob file path ignore issue and a fix will go out with the official 2.2.2 release shortly.

@mtycholaz and others with large lcov files that still have issues can track https://github.com/ryanluker/vscode-coverage-gutters/issues/185 instead.