Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Turn quadratic time on number of impl blocks into linear time
Previously, if you had a lot of inherent impl blocks on a type like: struct Foo; impl Foo { fn foo_1() {} } ... impl Foo { fn foo_100_000() {} } The compiler would be very slow at processing it, because an internal algorithm would run in O(n^2), where n is the number of impl blocks. Now, we add a new algorithm that allocates but is faster asymptotically. If there is an overlap between multiple impl blocks in terms of identifiers, we still run a O(m^2) algorithm on groups of impl blocks that have overlaps, but that m refers to the size of the connected component, which is hopefully smaller than the n that refers to the sum of all connected components.
- Loading branch information
Showing
1 changed file
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters