rust-lang / rust-lang/rust-analyzer

Macro-expanding large `vec!` with numbers is very slow (`georust/geo`)

Open
#11,108 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macro A-perf C-bug S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

https://github.com/georust/geo/, tested at d606fc5f01a6927f5e6033b09df7d404155b5637

[ERROR project_model::workspace] cyclic deps: jts_test_runner(CrateId(281)) -> geo(CrateId(209)), alternative path: geo(CrateId(209)) -> jts_test_runner(CrateId(281))
Database loaded:     863.07ms, 219minstr (metadata 405.64ms, 15minstr; build 388.92ms, 5863kinstr)
  crates: 20, mods: 175, decls: 1971, fns: 1470
Item Collection:     5.87s, 57ginstr
  exprs: 480353, ??ty: 93 (0%), ?ty: 3 (0%), !ty: 0                                                                          
Inference:           248.09s, 2694ginstr
Total:               253.96s, 2751ginstr

Possibly related to the large test fixtures that are include!ed (geo/src/algorithm/test_fixtures/norway_main.rs).

EDIT: I think it was related to the include!. Make sure to test on that commit, the code was removed in https://github.com/georust/geo/pull/703.

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

Reproduce the report against commit d606fc5f01a6927f5e6033b09df7d404155b5637 and compare the reported inference time. Start with geo/src/algorithm/test_fixtures/norway_main.rs and its include! usage, then review the linked geo pull request where that code was removed. Done means establishing whether the historical fixture caused the slowdown and documenting the result or a current reproduction path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
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.