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

Well, it disables *a* cache.  The docs don't make it clear, but it
seems like it only disables the test-cache.  I don't see why it would
affect the build caches -- build time being my theory as to why the
tests are slower.  But maybe it does?  Or maybe the extra time isn't
being spent in building after all.

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

I should have done!

craig

On Mon, Oct 26, 2020 at 4:16 AM Shulhan <m.shul...@gmail.com> wrote:
>
>
>
> > 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/CAGXKyzFDzQizBGFCvFvtLXa7H6wDtqUKXuZTxfqr2vC2x5%2BOUw%40mail.gmail.com.

Reply via email to