Speculator.jl reduces latency by automatically searching for compilable methods.
julia> using Pkg: add
julia> add("Speculator")
julia> using Speculator
julia> module Showcase
export g, h
f() = nothing
g(::Int) = nothing
h(::Union{String, Symbol}) = nothing
end;
julia> speculate(Showcase; verbosity = debug)
[ Info: Compiled `Main.Showcase.g(::Int)`
[ Info: Compiled `Main.Showcase.f()`
julia> speculate(Base.isexported, Showcase; verbosity = debug)
[ Info: Skipped `Main.Showcase.g(::Int)`
julia> speculate(Showcase.h; limit = 2, verbosity = debug)
[ Info: Compiled `Main.Showcase.h(::String)`
[ Info: Compiled `Main.Showcase.h(::Symbol)`
julia> install_speculator(; limit = 4, verbosity = debug)
[ Info: The input speculator has been installed into the REPL
julia> i(::Union{String, Symbol}, ::AbstractChar) = nothing;
[ Info: Compiled `Main.i(::Symbol, ::LinearAlgebra.WrapperChar)`
[ Info: Compiled `Main.i(::String, ::LinearAlgebra.WrapperChar)`
[ Info: Compiled `Main.i(::Symbol, ::Char)`
[ Info: Compiled `Main.i(::String, ::Char)`
- Precompile packages
- Compile interactively
- Filter values
- Run in the background
- Handle abstractly typed methods
- Save compilation directives to a file
- Show logging statements
- Disable during development using Preferences.jl?
- Support for
UnionAll
types?
- Cthulhu.jl
- CompileTraces.jl
- JET.jl
- MethodAnalysis.jl
- PackageCompiler.jl
- PkgCacheInspector.jl
- PrecompileSignatures.jl
- PrecompileTools.jl
- SnoopCompile.jl
Credit to Cameron Pfiffer for the initial idea.
The preexisting package PrecompileSignatures.jl implements similar functionality,
notably that PrecompileSignatures.@precompile_signatures ::Module
is roughly equivalent to Speculator.speculate(::Module)
.
The idea to compile concrete method signatures has also been brought up in PrecompileTools.jl #28.