Skip to content

Commit 7ed1efd

Browse files
Update the instruction set used to build our images (#6446)
both in Arm and x86. This remains very conservative.
1 parent fda2a4a commit 7ed1efd

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.cargo/config.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ rustflags = ["--cfg", "tokio_unstable"]
33
rustdocflags = ["--cfg", "tokio_unstable"]
44

55
[target.x86_64-unknown-linux-gnu]
6-
# Targeting x86-64-v2 gives a ~2% performance boost while only
7-
# disallowing Intel CPUs older than 2008 and AMD CPUs older than 2011.
8-
# None of those very old CPUs are used in GCP
9-
# (https://cloud.google.com/compute/docs/cpu-platforms). Unfortunately,
10-
# AWS does not seem to disclose the exact CPUs they use.
11-
rustflags = ["-C", "target-cpu=x86-64-v2", "--cfg", "tokio_unstable"]
6+
# x86-64-v3 requires AVX2, BMI1/BMI2, FMA — available on Intel Haswell (2013)+
7+
# and AMD Zen 1 (2017)+. Covers all current-gen AWS and GCP instance families.
8+
# GCP N1 on Sandy/Ivy Bridge is the only notable exclusion (legacy, not recommended).
9+
# BMI2 (PEXT/PDEP) benefits bit-manipulation-heavy paths in Tantivy.
10+
rustflags = ["-C", "target-cpu=x86-64-v3", "--cfg", "tokio_unstable"]
11+
12+
[target.aarch64-unknown-linux-gnu]
13+
# Targeting neoverse-n1 covers AWS Graviton2+ and GCP T2A (Ampere Altra).
14+
# Key gains over generic ARMv8-A: LSE atomics (better concurrency), dot
15+
# product instructions, and ARMv8.2 crypto extensions.
16+
rustflags = ["-C", "target-cpu=neoverse-n1", "--cfg", "tokio_unstable"]
1217

0 commit comments

Comments
 (0)