On Tuesday, September 29, 2015 at 2:16:36 AM UTC-4, Sheehan Olver wrote: > > > I'm wondering if its possible to have functions precompiled for specific > types during the __precompile__ stage, so that this does not need to be > repeated for each using? > > Gadfly seems to do this by defining a _precompile_() function, but it's > unclear whether that's compiling during the __precompile__ stage, vs during > the loading stage. >
The `__precompile__` stage just imports the package, and caches anything that was compiled during a normal `import`. So, if you want to precompile certain function signatures, you can just add `precompile(myfunction, (argtypes...))` calls in the body of your module. The SnoopCompile package automates this process to a certain degree, by detecting which functions it would be most advantageous to precompile.
