I was looking at some benchmark tests from https://github.com/RoaringBitmap/roaring
When running a specific benchmark using -run - (as mentioned in there comments):
go test -bench BenchmarkNexts -benchmem -run - It seems to execute faster, at least running it without -run - seems to have some initial overhead of 5 seconds also this is plotted:
==roaring==
{1,2,3,4,5,100,1000}
{3,4,1000}
{}
Cardinality: 7
Contains 3? true
1
3
4
5
1000
Wrote 22 bytes
I wrote the content to a byte stream and read it back.
size before run optimize: 1810 bytes, and after: 38 bytes.
As the -run flag runs tests based on a regex pattern it seems like something is excluded here but what exactly as both run the same tests the only difference is the initial overhead.
That is the expected result. It's faster when you don't run any tests.
To see what is being executed, add the
-voption to yourgo testexecutions.Run no tests:
Run all tests:
or, since
-run .is equivalent to all tests,