(Replying to PARENT post)
In practice, Julia's multiple dispatch is almost always devirtualized. That is, dispatch is resolved at compile time.
Generic code relies on specialization instead of dynamic dispatches to be generic with respect to input types. That is, for each new input type, a new method gets compiled (allowing the dispatch to be resolved statically).
๐คcelrod๐4y๐ผ0๐จ๏ธ0
(Replying to PARENT post)
Julia is fairly fast, since its type system _only_ does dynamic/runtime typing, the JIT is optimized towards that. You'll experience some minor startup lag, typically due to initial JIT'ing of any new used functions. However, this has largely be remedied with a compiler backend that completely precomputes this behavior. https://julialang.github.io/PackageCompiler.jl/dev/
๐คThomasMoll๐4y๐ผ0๐จ๏ธ0
(Replying to PARENT post)
The key thing that resolves this is that for type stable code, Julia doesn't do dispatch at runtime. For most real world problems, Julia will know all the methods at compile-time, and therefore doesn't chase pointers at all.
๐คadgjlsfhk1๐4y๐ผ0๐จ๏ธ0
(Replying to PARENT post)