Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint(track_config): optimize concept cycle checking slightly (#489)
We were concatenating a sequence with a one-item sequence, but it's better to use the `&` overload that appends one item [1][2]. The Nim compiler deliberately doesn't optimize the former into the latter. The concept cycle checking is a hot spot on tracks with a larger number of Concept Exercises. For example, with the csharp track, about a third of the `configlet lint` execution time was spent in `checkForCycle`. This commit removes some unnecessary allocations within that hot spot, and thereby produces a small (but consistent) `configlet lint` speedup of 3-5% on such tracks. [1] https://github.com/nim-lang/Nim/blob/9084d9bc02bc/lib/system.nim#L1672-L1686 [2] https://github.com/nim-lang/Nim/blob/9084d9bc02bc/lib/system.nim#L1688-L1701
- Loading branch information