title: Why is Julia taking a long time on the first call into my module?
body: <p>Essentially the situation I have is this. I have a module (which also imports a number of other modules).</p>
  
  <p>I have a script like:</p>
  
  <pre><code>import MyModule
  
  tic()
  MyModule.main()
  
  tic()
  MyModule.main()
  </code></pre>
  
  <p>In MyModule:</p>
  
  <pre><code>__precompile__()
  
  module MyModule
      export main
  
      function main()
          toc()
          ...
      end
  end
  </code></pre>
  
  <p>The first <code>toc()</code> call outputs around 20 seconds. The second outputs 2.3e-5. Can anyone offer a guess as to where the time is going? Does Julia do some kind of initialization on the first call into a module, and how can I figure out what that is?</p>