scoverage/scalac-scoverage-plugin — pull request #35 by RichardBradley (2014-05-15 17:15:41+00:00)
Title: Don't reopen the coverage file each time; on windows that is very slow.

This patch uses `ThreadLocal`s to avoid re-opening the coverage file on each executed statement.
"`flush()`" is used so that the coverage file is still always up-to-date, even if the instrumented JVM is abruptly killed.

On my windows machine, this took a `sbt clean scoverage:test` from 10m52 to 6m20 and a `sbt scoverage:test` with no clean (after a previous scoverage run) from 8m36 to 3m22. I think these numbers may overstate the benefit of this change (the length of the runs stops me from doing enough runs to get a good sized sample), but I do think this helps a lot with performance.