-
Notifications
You must be signed in to change notification settings - Fork 787
Debugging coverage performance? #556
Comments
@mramato I just ran into a performance problem, and I'm hoping my findings can help you. Istanbul uses https://github.com/mklabs/node-fileset at startup, and inputs In theory this seems perfectly fine. But Which means that at startup, even though On our codebase at work, the time it takes to do so is quite extreme (these are the defaults istanbul uses https://github.com/istanbuljs/istanbul-api/blob/929abf6922e21eebcea694e9f8b0058fbfb207d7/lib/file-matcher.js#L25-L32):
Removing the
So I fixed this by changing my instead of: do: Execution time dropped in half! |
Thanks for the suggestion @kirbysayshi, unfortunately your issue doesn't appear to be the source of my problem. I'm not running the cover on the command line, but instead running programatically through karma. I was also already specifying my own include filter. I spent some time debugging and tweaking the code (I even hardcoded some changes in |
Sorry to hear that @mramato ! Did you try hard coding a list of files for file-matcher to return? Just to remove any chance of this issue being the source of your performance woes? |
Yes,I went into the Thanks again anyway. |
Closes gotwarlost#556. Makes coverage run much faster, especially on bigger code bases.
I'm not sure if an issue is the right way to ask for help, if it's not I apologize, but I couldn't find anyplace better.
I'm a maintainer on the Cesium project and we've recently switched our 200,000 line JavaScript code base over to use karma (over 7200 jasmine unit tests). The entire test suite runs in less than 40 seconds.
I've used istanbul in my other (smaller) projects, and love it. That being said, we are now trying to switch over code coverage in Cesium from an ancient version of JSCoverage to istanbul via karma-coverage and running into a major performance hurdle. Our old system takes about 90 seconds total to instrument and cover. However, running the same tests via istanbul takes over 7 minutes (and only if I comment a couple of tests that were taking upwards of 5 minutes each). I also had to jack up
browserNoActivityTimeout
andbrowserDisconnectTimeout
in karma just to try and get it to run to completion (and that has only happened once so far and took 10 minutes, the results were not repeatable.I can't say for certain, but it seems earlier tests run way faster and things just get slower as the tests go on. A few seemingly innocuous tests seem to take multiple minutes to complete on their own (but execute in seconds when not run under coverage). I'm not sure it's any particular test causing issues though.
I've tried multiple launchers and browsers in case that was the problem (we usually use Chrome by default), but all browsers exhibited the same performance issue.
It happens on both Windows and Linux.
While I don't expect anyone to magically solve my problem, I am hoping that someone can provide tips for tracking down whatever the root cause of the problem may be. Perhaps there are some options I can tune or extra logging commands I can run to figure out what is taking so long. I'd be more than happy to submit a pull request with performance improvements if it turns out that is the problem (vs some bug slowing things down)
Here's the relevant configuration we are using:
https://github.com/AnalyticalGraphicsInc/cesium/blob/coverage/Specs/karma-main.js
https://github.com/AnalyticalGraphicsInc/cesium/blob/coverage/Specs/karma.conf.js
https://github.com/AnalyticalGraphicsInc/cesium/blob/coverage/gulpfile.js#L281
Any help would be greatly appreciated, and thanks again for a great project.
The text was updated successfully, but these errors were encountered: