Is it a representative benchmark? I see strange results on it: BenchmarkClientServerParallel 50000 123094 ns/op ...
12 years, 9 months ago
(2012-08-14 21:56:38 UTC)
#2
Is it a representative benchmark?
I see strange results on it:
BenchmarkClientServerParallel 50000 123094 ns/op
BenchmarkClientServerParallel-2 100000 81216 ns/op
BenchmarkClientServerParallel-4 100000 55722 ns/op
BenchmarkClientServerParallel-8 10000 302047 ns/op <<-- here
BenchmarkClientServerParallel-16 10000 324270 ns/op <<-- and here
However if I change
-P := runtime.GOMAXPROCS(-1) * 32
+P := 100
then it looks reasonable:
BenchmarkClientServerParallel 50000 136820 ns/op
BenchmarkClientServerParallel-2 100000 73536 ns/op
BenchmarkClientServerParallel-4 100000 43542 ns/op
BenchmarkClientServerParallel-8 200000 33484 ns/op
BenchmarkClientServerParallel-16 100000 37460 ns/op
I see absolutely the same thing on TCP net benchmarks. Something with high
number of goroutines...
On 2012/08/16 11:23:48, dfc wrote: > Looks reasonable to me. I think you should add ...
12 years, 9 months ago
(2012-08-17 17:30:25 UTC)
#4
On 2012/08/16 11:23:48, dfc wrote:
> Looks reasonable to me. I think you should add a P=100 case as well if you
think
> it shows something interesting.
PTAL
I've added cases with GOMAXPROCS*4 and GOMAXPROCS*64. There is indeed something
interesting. I have no explanation for now. When supplied with high number of
descriptors epoll sometimes returns in 4mks and sometimes in 30000mks. Does
somebody see the same picture?
BenchmarkClientServerParallel4 50000 175669 ns/op
BenchmarkClientServerParallel4-2 100000 82637 ns/op
BenchmarkClientServerParallel4-4 100000 52903 ns/op
BenchmarkClientServerParallel4-8 100000 294324 ns/op
BenchmarkClientServerParallel4-16 100000 454013 ns/op
BenchmarkClientServerParallel64 10000 153067 ns/op
BenchmarkClientServerParallel64-2 20000 87302 ns/op
BenchmarkClientServerParallel64-4 10000 302023 ns/op
BenchmarkClientServerParallel64-8 10000 325881 ns/op
BenchmarkClientServerParallel64-16 10000 904687 ns/op
PTAL http://codereview.appspot.com/6441134/diff/9001/src/pkg/net/http/serve_test.go File src/pkg/net/http/serve_test.go (right): http://codereview.appspot.com/6441134/diff/9001/src/pkg/net/http/serve_test.go#newcode1303 src/pkg/net/http/serve_test.go:1303: P := runtime.GOMAXPROCS(-1) * conc On 2012/08/20 05:51:29, ...
12 years, 9 months ago
(2012-08-20 09:13:19 UTC)
#8
PTAL
http://codereview.appspot.com/6441134/diff/9001/src/pkg/net/http/serve_test.go
File src/pkg/net/http/serve_test.go (right):
http://codereview.appspot.com/6441134/diff/9001/src/pkg/net/http/serve_test.g...
src/pkg/net/http/serve_test.go:1303: P := runtime.GOMAXPROCS(-1) * conc
On 2012/08/20 05:51:29, bradfitz wrote:
> capital P? how about just numProcs? it's not used often.
Done.
http://codereview.appspot.com/6441134/diff/9001/src/pkg/net/http/serve_test.g...
src/pkg/net/http/serve_test.go:1312: b.Logf("Get: %v", err)
On 2012/08/20 05:51:29, bradfitz wrote:
> Logf or Errorf? Seems like you want Errorf.
I am not sure. First, Errorf() in a child goroutine does not abort benchmark.
Second, I am not sure that I want to abort it here, because occasionally I see
some transient errors on Linux/Mac. Sometimes I just can't get a clean run with
-cpu=1,2,4,8,12,16 -benchtime=10, it's better if you may decide that few errors
are OK for such benchmark.
Note that there is a panic if response body is incorrect.
Issue 6441134: code review 6441134: net/http: add parallel client/server benchmark
(Closed)
Created 12 years, 9 months ago by dvyukov
Modified 12 years, 8 months ago
Reviewers:
Base URL:
Comments: 5