tarpaulin
tarpaulin copied to clipboard
Too slow for a large project
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
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
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 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
I agree. 121k loc is not a mid-sized. Changed the title.
@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:
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)