tarpaulin icon indicating copy to clipboard operation
tarpaulin copied to clipboard

Too slow for a large project

Open kdy1 opened this issue 4 years ago • 5 comments

While trying to add code coverage to swc, I hit timeout from github actions, which is 6 hours. Without tarpaulin, it takes 13 minutes.

Related PR: https://github.com/swc-project/swc/pull/634 Log; https://github.com/swc-project/swc/pull/634/checks?check_run_id=432131381

kdy1 avatar Feb 08 '20 06:02 kdy1

I'm not sure if I'd call that a mid-sized project it's just over 121kloc! There is a release flag for tarpaulin that builds and runs tests as release binaries though this could increase the impact of false negatives due to optimisations. I'm just going to run on my machine with and without the release flag and see how that impacts the time. Another option is excluding any particularly heavy tests

xd009642 avatar Feb 08 '20 18:02 xd009642

So on my system 16 minutes for the tests just doing cargo tarpaulin and exporting the CARGO_MANIFEST_DIR. There's probably some other variables I needed as some tests failed the release option didn't seem to speed things up, but I'd imagine the difference would only be significant if most of the heavy computation was done in 3rd party crates so it was a bit of a gamble

xd009642 avatar Feb 09 '20 11:02 xd009642

@xd009642 For the first, thank you for trying it. The test of swc is slow because it spawns lots of node js process. So release mode will not help.

Another option is excluding any particularly heavy tests

This seems interesting. I'll try it on my linux machine

kdy1 avatar Feb 09 '20 12:02 kdy1

I agree. 121k loc is not a mid-sized. Changed the title.

kdy1 avatar Feb 09 '20 12:02 kdy1

@kdy1 the latest change in develop might speed things up by changing less linker args if you want to be brave and go for the latest commit on develop for your CI :sweat_smile:

xd009642 avatar Nov 03 '20 23:11 xd009642

Closing this issue as the llvm coverage backend is now released --engine llvm where tests will run as fast as they do in cargo test with the llvm coverage enabled (which is faster than ptrace for large projects)

xd009642 avatar Oct 13 '22 17:10 xd009642