> On 26 Oct 2020, at 10.32, Craig Silverstein <csilv...@khanacademy.org> wrote:
> 
> > But in my experimenting the overhead of calling `go test` is quite high: 
> > `go test -count 1 <pkg1>; go test -count 1 <pkg2>` is 50% slower than `go 
> > test -count1 <pkg1> <pkg2>`.
> 
> Oops, I forgot to take parallelism into account.  Once I do, it drops to 30% 
> slower (which is still significant):
> 
> % time go test ./pkg/...
> [...]
> 97.100u 9.512s 0:34.22 311.5% 0+0k 31728+2640816io 79pf+0w
> 
> % time sh -c 'find pkg -type d | parallel -iFOO go test -count 1 ./FOO'
> [...]
> 127.725u 18.722s 0:44.26 330.8%       0+0k 164592+2509424io 443pf+0w
> 
> I'm curious why it's so much slower to run the tests one at a time than all 
> at once.  What work is being redone? -- I'd think anything slow would have 
> been cached.
> 

You realize that the flag "-count 1" disable the cache, right?

Also, why not using the "-p" flag if you want it to be parallel?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/B3C847EA-DC0E-402B-B177-CEE22D9DF0C3%40gmail.com.

Reply via email to