Skip to content

Rust module path lookups rescan every node per use edge, so cold Rust builds take tens of minutes #5665

Backlog

Description

@Max17190

On v8 at d249de36 (0.9.124), a cold build of a Rust workspace spends almost all of its time in _rewire_unique_stub_nodes at graphify/extract.py:5324.

For every Rust use crate::, super::, self:: or workspace crate path, the pass scans the whole node list and calls Path.resolve() on node paths. _module_file_nodes, _module_nodes_from, _lib_file_for_crate and _unmanifested_module_nodes each repeat that scan per edge, so the cost is Rust use edges times graph nodes.

Cold graphify update . Total _rewire_unique_stub_nodes
rust-analyzer 54bb01f636 1890s 1862s
tauri 4bcbccecce 118s about 105s

To reproduce, clone tauri at 4bcbccecce and run time graphify update . on Linux with CPython 3.12.3.

Expected: each lookup costs work per distinct file, and the output does not change.

Activity

  1. github-actions commented on Dec 1, 2026

    @github-actions

    Thanks for opening this issue, @Max17190. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. changed the title [-]Rust module-path lookups rescan every node per use edge, so cold Rust builds take tens of minutes[/-] [+]Rust module path lookups rescan every node per use edge, so cold Rust builds take tens of minutes[/+] on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions