Skip to content

Consider hashing nodes in AstIdMap for more stable IDs #19821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Veykril opened this issue May 19, 2025 · 1 comment · May be fixed by #19837
Open

Consider hashing nodes in AstIdMap for more stable IDs #19821

Veykril opened this issue May 19, 2025 · 1 comment · May be fixed by #19837
Labels
A-perf performance issues C-enhancement Category: enhancement

Comments

@Veykril
Copy link
Member

Veykril commented May 19, 2025

Right now we user a bread-first/depth-first hybrid tree walk to sequentially assign IDs to nodes. This is super unstable, adding a single node having the potential to invalidate the majority of IDs in the map. Something the rustc folks are considering is hashing (a subset) of a given node and using that hash as the ID instead for their IDs. This produces a lot more stable IDs, we should consider this!

@Veykril Veykril added A-perf performance issues C-enhancement Category: enhancement labels May 19, 2025
@davidbarsky
Copy link
Contributor

Zulip discussion, for context: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Stable-r.20Ast.20IDs/near/519046984.

(I think it was @P1n3appl3 who was explaining hashing nodes to Lukas and I as part of rust-lang/compiler-team#790.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-perf performance issues C-enhancement Category: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants