Short answer: yes, adding dependencies will increase compilation time.
Unfortunately, trying to import only individual functions from a module won’t help. So doing import PyPlot: imshow won’t be any faster than using PyPlot. Folks with more knowledge of the compiler could perhaps give a more detailed answer but I believe it just boils down to the fact that a function in a given module might call other functions in that same module and it’s hard determine what exactly to compile when do using Foo: bar
However, it’s important to point out that I’m using the term “compile” pretty loosely above. The last paragraph is about what happens when you do using Foo or import Foo. That includes things like parsing of source code and lowering to an internal intermediate format but not the full pass through LLVM to generate machine code. When you actually call a function at runtime with concrete inputs, then julia can fully compile that function for the given input arguments. I don’t think that bit should be affected by adding extra dependencies.
On a final note, there’s no performance difference between using and import. The difference is just in how they bring names into scope.
Thanks for the answer! I don’t know that much about the compilation details of importing. However, I have tested that doing import Gadfly: plot does not suffice for running Gadfly.plot( Coord.Cartesian( xmin=0, xmax=1 ), more_arguments... ), because Gadfly.Coord needs to be imported explicitly. The compiler does not do it by itself.
Therefore, it seems that the compiler does not necessarily try to resolve classes that are used by the imported function. Your point about functions in a module calling other functions still stands, I don’t know how the compiler deals with this.
This is just a matter of Gadfly.Coord not being brought into scope. It’s orthogonal to how much work is being done by the using and import statements. I don’t have Gadfly installed right now but here’s an experiment you can do to demonstrate this: