Set Base.Experimental.@max_methods 1
#2068
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From Julia 1.8 onwards, there is the
Base.Experimental.@max_methods
setting (JuliaLang/julia#43370). See especially JuliaLang/julia#43370 (comment) for an example of what this setting does.In
Pluto.jl
, I've seen a bunch of methods showing inferred fields asUnion{Vector{Tuple}, Vector{Tuple{Any}}}
or other unhelpful types. It's better if the compiler would waste time on that, just inferAny
and compile a runtime dispatch.Benchmarks
Below are the benchmarks for compilation time and some random extra benchmarks to verify that running time isn't seriously affected. All benchmarks on Julia 1.8-beta3:
Without
@max_methods
(main
)With
@max_methods
(this PR)