rust-lang / rust-lang/rust

Rust 1.81-nightly slower than Rust 1.79 ?

Open
#126,937 46 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-mir-opt-inlining C-bug I-slow O-AArch64 O-macos P-medium regression-untriaged S-has-mcve
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Hi,

I've build my rust project with Rust 1.79 and now test with Rust 1.81 nightly.

I observe slower runtime.

This project is about parsing text files with polars.
Cargo.toml is the same in both context.

With Rust 1.79

# cargo build release with 1.79.0
cargo +1.79.0 build --release      
...

# benchmark on release run 
bench ./target/release/pmsi_rust   
benchmarking ./target/release/pmsi_rust
time                 236.9 ms   (226.6 ms .. 249.0 ms)
                     0.998 R²   (0.991 R² .. 1.000 R²)
mean                 232.1 ms   (228.1 ms .. 236.8 ms)
std dev              5.880 ms   (3.339 ms .. 8.859 ms)
variance introduced by outliers: 14% (moderately inflated)

With Rust 1.81

# With 1.81 version
% cargo --version      
cargo 1.81.0-nightly (bc89bffa5 2024-06-22)
# build release with 1.81
% cargo build --release           
...
# benchmark on release run
% bench ./target/release/pmsi_rust
benchmarking ./target/release/pmsi_rust
time                 614.8 ms   (528.0 ms .. 710.4 ms)
                     0.997 R²   (0.989 R² .. 1.000 R²)
mean                 644.2 ms   (622.9 ms .. 664.8 ms)
std dev              25.50 ms   (11.26 ms .. 31.11 ms)
variance introduced by outliers: 19% (moderately inflated)

It's an issue just to keep trace of this observation, is this feedback something you've encountered before?
Maybe it's just normal as 1.81 is a beta.

If not, I can make a reproducible example I think.

Thanks

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 rebuilding the same project from its Cargo.toml with cargo +1.79.0 build --release and the reported Rust 1.81 nightly, then rerun the bench command against target/release/pmsi_rust. A useful outcome is a reproducible comparison with the project or a reduced example that identifies whether the slowdown comes from Rust or the polars-based workload.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.