Skip to content

Commit

Permalink
optimize reordering of ml-matches to avoid unnecessary computations
Browse files Browse the repository at this point in the history
This now chooses the optimal SCC set based on the size of lim, which
ensures we can assume this algorithm is now << O(n^2) in all reasonable
cases, even though the algorithm we are using is O(n + e), where e may
require up to n^2 work to compute in the worst case, but should require
only about n*min(lim, log(n)) work in the expected average case.

This also further pre-optimizes quick work (checking for existing
coverage) and delays unnecessary work (computing for *ambig return).
  • Loading branch information
vtjnash committed May 12, 2023
1 parent 6a5f51b commit ac1cb1c
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 153 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ julia> g(2.0, 3.0)
ERROR: MethodError: g(::Float64, ::Float64) is ambiguous.
Candidates:
g(x::Float64, y)
@ Main none:1
g(x, y::Float64)
@ Main none:1
g(x::Float64, y)
@ Main none:1
Possible fix, define
g(::Float64, ::Float64)
Expand Down
Loading

0 comments on commit ac1cb1c

Please sign in to comment.