mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
* Tune FAR aggregation In making the work queue management more intelligible, we centralized the redundancy check at dequeue time. As a result, the queue tends to get very large (~1.6M items for `SyntaxKind` in this repo) and dequeuing via `shift` is too slow to do that many times. This change makes a few tweaks: 1. Use `Project` identity for de-duping and only maintain a set of keys for `loadAncestorProjectTree` 2. Attempt to filter prior to insertion 3. Use `splice` if many consecutive work queue items will be discarded. On my box, this cuts FAR for `SyntaxKind` in parser.ts from 38 minutes to 20 seconds (we could do better, but effectively decided not to optimize this worst case scenario).