Skip to content

Compile / typecheck perf regression in 0.16 from proc macro changes #18103

Closed
@h3r2tic

Description

@h3r2tic

Bevy version

Relevant system information

cargo --version
cargo 1.85.0 (d73d2caf9 2024-12-31)
uname -a
Linux h3-arch 6.12.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 x86_64 GNU/Linux

What's performing poorly?

Howdy! I've upgraded Tiny Glade's Bevy deps to 0.16.0-dev to play around with auto-registration of reflection info, and I've noticed Rust Analyzer being sluggish. The Rust Analyzer slowdown is also reflected in running build/check/clippy. I've bisected it down to #17330

The test I'm doing is touching/modifying a single .rs file in our chonkiest crate The numbers are best out of a few runs.

Using bevy at commit 669d139:

  • Rust Analyzer build (running clippy) after a ctrl+s: 6.53s
  • cargo clippy: 5.36s
  • cargo check: 1.98s
  • cargo build (touch one .rs file, no change): 3.03s
  • cargo build: (modify one function) 4.39s

Using bevy at commit 1b7db89:

  • Rust Analyzer build (running clippy) after a ctrl+s: 12.40s
  • cargo clippy: 11.19s
  • cargo check: 7.83s
  • cargo build (touch one .rs file, no change): 8.78s
  • cargo build (modify one function): 10.18s

Before and After Traces

Traces for touching a single .rs file and running cargo build --timings

Additional information

Here's our Bevy dependencies:

bevy_app = "0.16.0-dev"
bevy_ecs = { version = "0.16.0-dev", features = ["multi_threaded", "serialize"] }
bevy_input = { version = "0.16.0-dev", features = ["serialize"] }
bevy_log = "0.16.0-dev"
bevy_reflect = { version = "0.16.0-dev" }
bevy_state = { version = "0.16.0-dev", default-features = false, features = ["bevy_app", "bevy_reflect"] }
bevy_tasks = "0.16.0-dev"
bevy_time = { version = "0.16.0-dev", default-features = false }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Cross-CuttingImpacts the entire engineC-BugAn unexpected or incorrect behaviorC-PerformanceA change motivated by improving speed, memory usage or compile timesP-RegressionFunctionality that used to work but no longer does. Add a test for this!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions