Benchmarking rustls 0.23.15 vs OpenSSL 3.3.2 vs BoringSSL on x86_64

2024-10-18

System configuration

We ran the benchmarks on a bare-metal server with the following characteristics:

Versions

The benchmarking tool used for both OpenSSL and BoringSSL was openssl-bench d5de57d9.

This was built from source with its makefile.

BoringSSL

The tested version of BoringSSL is 76968bb3d5, which was the most recent point on master when we started these measurements.

BoringSSL was built from source with CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release. clang is used here to avoid potential performance deficits to GCC.

OpenSSL

The tested version of OpenSSL is 3.3.2, which was the latest release at the time of writing.

OpenSSL was built from source with ./Configure ; make -j12.

Rustls

The tested version of rustls was 0.23.15, which was the latest release at the time of writing. This was used with aws-lc-rs 1.10.0 / aws-lc-sys 0.22.0.

Additionally the following two commits were included, which affect the benchmark tool but do not affect the core crate:

Measurements

BoringSSL was tested with this command:

~/bench/openssl-bench
$ BENCH_MULTIPLIER=16 setarch -R make measure BORINGSSL=1

OpenSSL was tested with this command:

~/bench/openssl-bench
$ BENCH_MULTIPLIER=16 setarch -R make measure

rustls was tested with this command:

~/bench/rustls
$ BENCH_MULTIPLIER=16 setarch -R make -f admin/bench-measure.mk measure

Results

Transfer measurements are in megabytes per second. Handshake units are handshakes per second.

BoringSSL 76968bb3OpenSSL 3.3.2rustls 0.23.15
transfer, 1.2, aes-128-gcm, sending5043.046560.798154.27
transfer, 1.2, aes-128-gcm, receiving4429.267192.177436.88
transfer, 1.3, aes-256-gcm, sending4332.55982.187094.13
transfer, 1.3, aes-256-gcm, receiving3872.346521.27278.15
BoringSSL 76968bb3OpenSSL 3.3.2rustls 0.23.15
full handshakes, 1.2, rsa, client5470.013201.928227.61
full handshakes, 1.2, rsa, server1449.652159.592829.04
full handshakes, 1.2, ecdsa, client3451.512071.744369.39
full handshakes, 1.2, ecdsa, server9115.045196.812921.68
full handshakes, 1.3, rsa, client4813.912788.766803.93
full handshakes, 1.3, rsa, server1386.061913.382544.31
full handshakes, 1.3, ecdsa, client3177.491859.773937.7
full handshakes, 1.3, ecdsa, server7107.863938.478325.74
BoringSSL 76968bb3OpenSSL 3.3.2rustls 0.23.15
resumed handshakes, 1.2, client45547.620703.864722.55
resumed handshakes, 1.2, server43985.322268.171149.91
resumed handshakes, 1.3, client9818.45328.610912.87
resumed handshakes, 1.3, server8600.764866.29500.11

graph of transfer speeds

graph of full handshakes

graph of resumed handshakes

Observations on results

AVX-512 support shows up twice in these results:

This support was contributed to the respective projects by Intel.

TLS1.3 resumption is slower than TLS1.2 resumption because it includes a fresh key exchange.