rust-lang / rust-lang/rust

Performance regression in nightly with target-cpu=native on znver4

Open
#139,370 27 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug I-slow O-x86_64 P-high regression-from-stable-to-stable T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

Hi, I have a regression when I try to run benchmarks using the nightly compiler on a crate that does elliptic curve operations:
In this repo: https://github.com/zama-ai/tfhe-rs, on branch v1.0 , in the crate tfhe-zk-pok, running the bench with RUSTFLAGS="-C target-cpu=znver4" cargo +nightly-2025-02-18 bench -p tfhe-zk-pok --bench pke_v2 -- pke_zk_verify_v2::PKEV2.

The machine running the bench is an aws hpc7 with an AMD EPYC 9R14 CPU.
Depending on the bench I get around 30% slower timings.

A bisect shows that the regression was introduced with nightly 2025-02-18. Stable toolchains do not seem to be impacted. The slowdown is only visible with -C target-cpu=znver4.

Version it worked on

All stable toolchains, and nightly before 2025-02-18.

Version with regression

nightly 2025-02-18 and after. The latest one as of today (2025-04-04) also has the regression.

Thank you for your help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report in tfhe-rs on branch v1.0 with the tfhe-zk-pok pke_v2 benchmark and the stated nightly toolchain, target CPU, and AWS hpc7 AMD EPYC 9R14 environment. Compare nightly 2025-02-18 and later against stable or an earlier nightly, then narrow the regression to the compiler change introduced by that release. Done means the znver4 benchmark no longer shows the reported slowdown and the regression is covered or explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.