denoland / deno_graph

The module graph logic for Deno CLI
https://docs.rs/deno_graph
MIT License
111 stars 39 forks source link

refactor: use an `IndexSet` for the graph roots #489

Closed dsherret closed 3 months ago

dsherret commented 3 months ago

Mainly 1, but rarely 2:

  1. This better represents the data because there can't be duplicates.
  2. It will make us more performant if someone has hundreds of thousands of dynamic imports (which is a secenario I never benchmarked tbh).

Used an IndexSet instead of BTreeSet because knowing the first specifier is sometimes useful.