Tarsnap / spiped

Spiped is a utility for creating symmetrically encrypted and authenticated pipes between socket addresses.
http://www.tarsnap.com/spiped.html
Other
855 stars 56 forks source link

perftest: transfering bytes, no encryption, pipes vs. socketpairs #380

Closed gperciva closed 1 year ago

gperciva commented 1 year ago

This is for investigating the variability in the existing standalone_pipe_socketpair_one.c test, which uses proto_pipe(). I took that test, replace the proto_pipe with a read(); write(); loop, and then made the communication endpoints either pipes, socketpairs, or socketpairs with the same socket options that are used in proto_conn.c.

Here's two visualizations of the same benchmarks, with N=31. Freebsd is 12.4 on bare metal; Linux is aws linux on a t2.

dots boxplots

I didn't play games with cpu pinning, because pipes vs. sockets seemed to be an interesting enough comparison as it is.

So my proposal is to omit the setsockopt() test, and and only merge the first two commits in this PR.

cperciva commented 1 year ago

Please retest with linux on a t3 instance; t2 is Xen-based and may have performance anomalies if Linux uses page-flipping.

It would also be good to check FreeBSD 13.2 (not 12.4) and on a comparable EC2 instance. I'm guessing FreeBSD isn't really 2x faster than Linux.

gperciva commented 1 year ago

Interesting results! t3.small, 5 warmup runs, N=101 recorded data

Two visualizations of the same data: dots boxplot

My take-aways:

I didn't play any games with cpu pinning or sysctl kern.timecounter.alloweddeviation or the like.

gperciva commented 1 year ago

I think that the pipe() vs. socketpair() test is interesting enough to be worth adding to git master (as part of standalone-enc).