Closed Luthaf closed 1 year ago
Awesome, I'll take a look when I'm done with work for the day (and when it's merged might fast track a new llvm profparsers release and tarpaulin release to make use of it :pray: )
I ran cargo fmt and force pushed!
All looks good to me (CI failure is me needing to rejiggle my actions to be more external contributor friendly RE coverage).
With the Vec -> HashMap change, I think it may have implications in the ordering functions are printed out by the profparser binary which I use to compare to the LLVM implementation for correctness in some tests. But it may not, need to either work out from looking at the code if it'll change report printout or just implement it and see
Ok, I might play with Vec => HashMap next time tarpaulin feels too slow and I have time to work on it 😃 Thanks for merging!
Not recomputing it everytime brings
CoverageMapping::generate_report
from 30s per test to 1s per test on my system when used inside cargo tarpaulin.I realised the
Mapping coverage data to source
part of cargo tarpaulin was very slow for me, andCoverageMapping::generate_report
was taking most of it. The flamegraph showed that most of that time was spend recomputing md5 hash inget_simple_counters
. Computing the hash only once when creating theNamedInstrProfRecord
dramatically cuts the run time.There might be more gains to have by changing the data structure from a
Vec<NamedInstrProfRecord>
to aHashMap<(u64, u64), NamedInstrProfRecord>
(using the fn_hash and name_hash as keys), but I'm not sure of the greater implications of this.