]> Cypherpunks repositories - gostls13.git/commit
io, net, http: sendfile support
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 25 May 2011 17:15:26 +0000 (10:15 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 25 May 2011 17:15:26 +0000 (10:15 -0700)
commitb0f39cc27cb3bcd0c9a53b158d8ea04d6f5c2e28
tree682b003c35555606404aeea124fe0a1d34f57061
parente94eb38975ecdb3d4ed0a200671b6470c0b791a3
io, net, http: sendfile support

Speeds up static fileserver, avoiding kernel/userspace copies.

Numbers: downloading 14 MB AppEngine Go SDK with ab (Apache Bench)
with 5 threads:

Before/after numbers:

CPU:
user    0m3.910s
sys     0m23.650s
->
user    0m0.720s
sys     0m4.890s

Time taken for tests:   8.906 seconds
->
Time taken for tests:   8.545 seconds

Percentage of the requests served within a certain time (ms)
50%     44
66%     45
75%     46
80%     46
90%     48
95%     51
98%     59
99%     71
100     74 (longest request)
->
50%     42
66%     43
75%     43
80%     44
90%     46
95%     57
98%     62
99%     63
100%    64 (longest request)

R=iant, gary.burd, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4543071
src/pkg/http/server.go
src/pkg/io/io.go
src/pkg/net/Makefile
src/pkg/net/sendfile_linux.go [new file with mode: 0644]
src/pkg/net/sendfile_stub.go [new file with mode: 0644]
src/pkg/net/sock.go
src/pkg/net/tcpsock.go