s3:smb2_server: for performance reasons we use tevent_fd and readv/writev directly
authorStefan Metzmacher <metze@samba.org>
Mon, 14 Oct 2013 08:33:57 +0000 (10:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2013 13:39:10 +0000 (14:39 +0100)
commit4244a2686cddcdc754c284df884ae497afa4053a
tree4d3b85a6fbb74b8ab99d15fa7acade2519e59cbf
parent9393e28df59954414313bfae70ffb796d3e332fe
s3:smb2_server: for performance reasons we use tevent_fd and readv/writev directly

Going via tevent_req_create/talloc_free at multiple layer costs
too much cpu cycles per request.

I tested downloading a 16GB (sparse) file with smbclient -b1 -mNT1,
and -mSMB2_02. Using smb2 max read = 64512, which means smb1 and smb2
will use the same read size.

I build with -O3 -g and compared the results with valgrind --tool=callgrind.

With -mNT1 the server uses about 2.000.000.000 cpu cycles.

This patch reduces the userspace cpu cycles for -mSMB2_02
from about ~ 8.000.000.000 down to ~ 4.000.000.000.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source3/smbd/globals.h
source3/smbd/smb2_server.c