Skip to content

Refactor: Performance improvement from O(n2) to O(n)

Latest
Compare
Choose a tag to compare
@thiagonache thiagonache released this 30 Sep 15:16
· 4 commits to main since this release
f2411f6

This release refactors the code completely. Now, instead of running go test -run with a different combination of tests, we are generating one cover profile go test -coverprofile [temporary file] -run filtering only the specific test at a time, and then we process the cover profiles to get the same metrics.

It has been shown to cut the total time to run in half for most cases but for some CPU-intensive tests, it decreased drastically. For example, to run for the package strconv in the std library, on my machine, the total time decreased from 60 secs to 15 sec.