Skip to content

benchmark

Mehrdad Arshad Rad edited this page Feb 20, 2021 · 5 revisions

User space

Setup

CPU Intel(R) Xeon(R) Platinum 8252C CPU @ 3.80GHz
OS Ubuntu Server 20.04 LTS
Kernel 5.4.0
Go 1.15.8

Decoder benchmark with single CPU core

TCP Fields# ns / op ns / field
6 524 87
9 694 77
GOMAXPROCS=1 go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/mehrdadrad/tcpdog/ebpf
BenchmarkDecoderV4SixFields         	 2295981	       524 ns/op
BenchmarkDecoderV4NineFields        	 1727460	       694 ns/op
PASS
ok  	github.com/mehrdadrad/tcpdog/ebpf	7.239s

SixFields: SAddr, DAddr, BytesReceived, BytesSent, RTT, TotalRetrans

NineFields: SAddr, DAddr, BytesReceived, BytesSent, RTT, PacketsOut, AdvMSS, TotalRetrans, DPort

Kernel space / eBPF stats

Setup

CPU Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz
OS Ubuntu Server 20.04 LTS
Kernel 5.4.0

3500 ns per count (with 1 and 6 fields, the results were identical)

run_time_ns:	35034
run_cnt:	10