Amazon
announced
the Graviton 3 processor and C7g instance family in November 2021, but it
took six months before they were ready for
general
availability; in the mean time, however, as the maintainer of the
FreeBSD/EC2 platform I was able to get early access to these instances.
As far as FreeBSD is concerned, Graviton 3 is mostly just a faster
version of the Graviton 2: Most things “just work”, and the things which
don’t work on Graviton 2 — hotplug devices and cleanly shutting down
an instance via the EC2 API — also don’t work on Graviton 3. (Want
to help get these fixed? Sponsor
my work on FreeBSD/EC2 so I have a few more paid hours to work on this.)
The one notable architectural difference with the Graviton 3 is
the addition of Pointer Authentication, which makes use of “unused” bits
in pointers to guard against some vulnerabilities (e.g. buffer overflows
which overwrite pointers). Andrew Turner recently
added
support for arm64 pointer authentication to FreeBSD.
But since Graviton 3 is largely a “faster Graviton 2”, the obvious question
is “how much faster” — so I launched a couple instances (c6g.8xlarge
and c7g.8xlarge) with 500 GB root disks and started comparing.
The first performance test I always run on FreeBSD is a quick microbenchmark
of hashing performance: The md5 command (also known as
sha1, sha256, sha512, and many other things) has
a “time trial” mode which hashes 100000 blocks of 10000 bytes each. I ran
a few of these hashes:
Graviton 2 | Graviton 3 | speedup | |
md5 | 2.26 s | 2.16 s | 1.05x |
sha1 | 2.67 s | 1.94 s | 1.38x |
sha256 | 0.82 s | 0.81 s | 1.01x |
sha512 | 2.87 s | 1.03 s | 2.79x |
The first two of these hashes (md5 and sha1) are implemented in FreeBSD as
pure C code; here we see Graviton 3 pulling slightly ahead. The sha256 and
sha512 hashes make use of the arm64 cryptographic extensions (which have
special instructions for those operations) so it’s no surprise that sha256
has identical performance on both CPUs; for sha512 however it seems that
Graviton 3 has far more optimized implementations of the arm64 extensions,
since it