inference.jl exists to infer your types at compile time. There are cases where it can't do so successfully, in which case the type indeed has to be determined at runtime. But this failure happens relatively rarely, and a "git log --oneline | grep -i infer" will show you that a lot of work has gone into making this work so well.
Play around with code_typed a bit to see this in action. A great source of information is http://blog.leahhanson.us/julia-introspects.html --Tim On Tuesday, July 08, 2014 11:08:24 PM Andrei Zh wrote: > (on a related note, for the same reason type assertions in a method > > > definition don't actually improve performance) > > > > On Tuesday, July 8, 2014 6:19:51 PM UTC-7, Iain Dunning wrote: > >> For your "additional" question: no overhead for the abstract version > >> versus the two specialized. Don't think of them as types like in C/C++ > >> function definition, think of them as a filter. Julia will compile a new > >> version for every type input you put in anyway that is specialized for > >> the > >> type parsed in. > > Does it mean that method dispatching, i.e. choice of concrete code to > execute, always happens in run-time and never in compile time? Is there > relevant C code on GitHub that I can look at?
