New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage collection at the end from .acv files is taking significant time #175
Comments
Exactly what is written to the The output to file is buffered and compressed to reduce the file I/O bottleneck impact upon the system being tested, with the size on disk per visit record being dependent on the compressibility of the visit stream. Multiple such files are a result of concurrency handling measures; for example separate For a simple visit process (e.g. one pass through most code), the compression makes each {module,line,count} visit around 12-13 bytes; but in instances where there is a tight loop with a great deal of repetition in the output stream, compression ratios down to tens of visits per output byte have been observed. A 300Mb file would thus represent at least ~25 million distinct visits, but potentially several billion. If you are using the command line, Alternatively, the Another approach would be to identify any hot spots, and arrange tests of the hot spots to be separate from the tests of the rest of the system (run with the hot spot types/methods involved being excluded from coverage), combining them all in post-processing. |
Finally got around to doing some performance testing, and with a program dominated by a tight loop - let n = 1000
for i in 1..n do
for j in 1..n do
use s = new System.IO.MemoryStream(1024)
use b = new System.IO.BinaryWriter(s)
for k in 1..n do
System.DateTime.UtcNow.Ticks
|> b.Write generated a > 300MB .acv file, which I processed on old, low-powered hardware and got
so it doesn't in fact look like the bottleneck is in the unpacking of the coverage data - indeed with a smaller test set, the throughput was lower
as the fraction of time spent unpacking dropped. Bearing all that in mind, the likelihood is that the issue reported here is a result of the size of the code being covered - and the consequent scaling of the in-memory representation of the report as it's being filled in - of necessity, a random-access thing. So, rather than just the size of the I've not done any comparisons at scale yet to compare the performance of the JSON representation vs the XML one, so cannot advise whether that might be another thing to try; but in any case the points made earlier -- reducing the number of data points collected and partitioning the testing across units before aggregating will still speed the process up. |
Hi Steve, Thank you for sharing the detailed insights about the time performance metrics with a quick test-set. We appreciate the observations provided in the comment. We also believe that a huge code repository can create a difference, i.e. introduce significant time latency while collecting the code coverage. We might need to look into how we can minimize the data points collected (need to investigate further into this). May be we can start partitioning the testing modules and club the coverage collected at the end, all in parallel, that seems a good way ahead. We will post the update how it goes! Thanks again! |
Just to confirm, there's no AltCover specific setting to speed up the coverage collection process, right? As per our understanding from the documentation. |
Quite a bit of a difference from opencover from coverlet vs altcover coverage reports taking a huge time |
@SteveGilham Any insights on what could be done here ? |
I see the instrumentation takes the quite long time compared to open cover with coverlet |
Up front, I don't think I can offer any quick wins with this, except that if you're getting many (hundreds or more) visits per location, there is some speed-up to be had from using the At the moment I don't have any clear indications of hot-spots; and any ground-up rewrite would be at best speculative. Can you indicate some metrics for the size of the work you're doing - how many kloc, how many total visits, that sort of thing. |
Something throwing an exception should be filed as a separate issue. And could you please post the log file with the exception trace in. |
@tilak-nanavati-opshub removed |
Hi Steve,
Altcover is working great. capturing the coverage of all the instrumented DLLs, but recently we have observed that the .acv files are growing and reaching ~300 MB, (and there are multiple such files), from these while collecting the coverage, it is taking a significant amount of time.
Observation: A file (~300 MB in size) takes more than 48 mins.
Is there any way we can reduce this time?
It would be a great help.
Thanks!
The text was updated successfully, but these errors were encountered: